我有这个使用Expression注入数据的注入器
/// <summary>
/// Inject a data to an instance of T
/// </summary>
/// <typeparam name="T">The type of object as parameter</typeparam>
/// <param name="data">Object instance to where the data is injected</param>
/// <param name="pairData">Set of data info</param>
public static void InjectData<T>(this T data, Dictionary<Expression<Func<T, object>>, object> pairData) where T : IAuditable
{
// posible content of T data
// Employee
// : Code
// : Name
// : ID
// possible content of pairData
// Key: a => a.Code …Run Code Online (Sandbox Code Playgroud)