我有以下属性的DB类:使用由计算属性过滤的实体框架从数据库中检索类的列表?
public string AwsS3Key { get; set; }
public bool PendingS3Upload => !string.IsNullOrEmpty(AwsS3Key);
我试图通过基于PendingS3Upload
属性过滤拉从我的上下文数据的列表。不过,我得到以下错误:
The specified type member 'PendingS3Upload' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.
我怎样才能提取数据从我的表,对于“计算”属性PendingS3Upload
?
啊。我将如何去创建计算列,特别是从我的Code First方法? –
@DanielBrown我已经更新了我的答案。 – SimonGates