我正在执行下面的代码,EFCore 抛出
类型的表达式
System.Nullable'1[System.Int32]
不能用于类型的构造函数参数System.Int32'\r\nParameter name: arguments[0]
var data= await _dbContext.Set<Person>().Select(person =>person.Profile != null ?
new ProfileDto(org.Profile.Id , org.Profile.Nickname) : null).ToListAsync();
Person 要么有配置文件,要么没有配置文件,因此 Person 上的 Profile 属性是可选的。