我有两个类:Role 和 CustomRole
public class CustomRole
{
public string RoleName { get; set; }
public int RoleId { get; set; }
}
public class Role
{
public string RoleName { get; set; }
public int RoleId { get; set; }
public int MyRole { get; set; }
}
在编译时,我有一个像这样的委托:
Func<CustomRole, bool> Del = o => o.RoleId > 0;
问题是在运行时我需要再创建一个具有相同条件的委托,但表名已更改
Func<Role, bool> Del1 = o => o.RoleId > 0;
我怎样才能做到这一点?