0
我使用实体框架的核心,我有以下几点:添加包括表达式动态
String expression = "Country;User;User.Country"
这表明,包括国家,用户和User.Country在查询:
var q = context.Jobs
.Include(x => x.Country)
.Include(x => x.User).ThenInclude(x => x.Country);
我做不知道表达会包含什么。我只知道它将是一个实体列表,有或没有子实体(例如:User.Country),我需要构建包含表达式。
有没有办法做到这一点?
查看重复,只是分割字符串,所以你有一个数组。 – CodeCaster