草庐IT

entity-system

全部标签

c# - 在 Entity Framework Core 中包含集合

例如,我有那些实体:publicclassBook{[Key]publicstringBookId{get;set;}publicListPages{get;set;}publicstringText{get;set;}}publicclassBookPage{[Key]publicstringBookPageId{get;set;}publicPageTitlePageTitle{get;set;}publicintNumber{get;set;}}publicclassPageTitle{[Key]publicstringPageTitleId{get;set;}publicstr

c# - 在 Entity Framework Core 中包含集合

例如,我有那些实体:publicclassBook{[Key]publicstringBookId{get;set;}publicListPages{get;set;}publicstringText{get;set;}}publicclassBookPage{[Key]publicstringBookPageId{get;set;}publicPageTitlePageTitle{get;set;}publicintNumber{get;set;}}publicclassPageTitle{[Key]publicstringPageTitleId{get;set;}publicstr

c# - Entity Framework Core 急切加载然后包含在集合中

我想在执行查询时包含三个模型。这是场景。publicclassSale{publicintId{get;set;}publicListSaleNotes{get;set;}}publicclassSaleNote{publicintId{get;set;}publicUserUser{get;set;}}publicclassUser{publicintId{get;set;}}我可以像这样急切加载SaleNotes..._dbContext.Sale.Include(s=>s.SaleNotes);但是,尝试使用ThenInclude从SaleNote中预先加载User模型具有挑战性

c# - Entity Framework Core 急切加载然后包含在集合中

我想在执行查询时包含三个模型。这是场景。publicclassSale{publicintId{get;set;}publicListSaleNotes{get;set;}}publicclassSaleNote{publicintId{get;set;}publicUserUser{get;set;}}publicclassUser{publicintId{get;set;}}我可以像这样急切加载SaleNotes..._dbContext.Sale.Include(s=>s.SaleNotes);但是,尝试使用ThenInclude从SaleNote中预先加载User模型具有挑战性

c# - 这里的 Actor 在哪里? LINQ to Entities 仅支持转换实体数据模型基元类型

我有许多EntityFramework表,我已经使用它们的部分类来支持接口(interface)IHistoricEntity。IHistoricEntity具有ActiveToDatetime?属性。//AutogeneratedLINQtoEntitiesdomainservice:[EnableClientAccess()]publicpartialclassProductService:LinqToEntitiesDomainService{publicIQueryableGetANALYSIS_CODES(){returnthis.ObjectContext.ANALYSIS

c# - 这里的 Actor 在哪里? LINQ to Entities 仅支持转换实体数据模型基元类型

我有许多EntityFramework表,我已经使用它们的部分类来支持接口(interface)IHistoricEntity。IHistoricEntity具有ActiveToDatetime?属性。//AutogeneratedLINQtoEntitiesdomainservice:[EnableClientAccess()]publicpartialclassProductService:LinqToEntitiesDomainService{publicIQueryableGetANALYSIS_CODES(){returnthis.ObjectContext.ANALYSIS

c# - 如何使用 Entity Framework 按日期而不是随时间分组

我的代码://getdatavarmyData=fromlogindb.OperationLogsgrouplogbylog.CreateTime.Dateintogorderbyg.Keyselectnew{CreateTime=g.Key,Count=g.Count()};这段代码会抛出EntityFramework不支持获取日期操作的异常。因为log.createtime都有日期和时间,我想按日期分组,怎么办 最佳答案 使用EntityFunctions.TruncateTimeMethod(Nullable).它将被翻译成T

c# - 如何使用 Entity Framework 按日期而不是随时间分组

我的代码://getdatavarmyData=fromlogindb.OperationLogsgrouplogbylog.CreateTime.Dateintogorderbyg.Keyselectnew{CreateTime=g.Key,Count=g.Count()};这段代码会抛出EntityFramework不支持获取日期操作的异常。因为log.createtime都有日期和时间,我想按日期分组,怎么办 最佳答案 使用EntityFunctions.TruncateTimeMethod(Nullable).它将被翻译成T

c# - Entity Framework 中的 LINQ to Entities 不支持 LINQ 表达式节点类型 'Invoke'

谁能帮我解决我的问题。我正在使用下面给出的代码:publicIEnumerableGetdata(Expression>predicate){returnAccountsContext.InvoiceHeaders.Include("Company").Include("Currency").Include("BusinessPartnerRoleList").Include("DocumentType").Where(predicate);}.....在我的代码中,我使用如下Expression>predicate=PredicateBuilder.True();predicate=

c# - Entity Framework 中的 LINQ to Entities 不支持 LINQ 表达式节点类型 'Invoke'

谁能帮我解决我的问题。我正在使用下面给出的代码:publicIEnumerableGetdata(Expression>predicate){returnAccountsContext.InvoiceHeaders.Include("Company").Include("Currency").Include("BusinessPartnerRoleList").Include("DocumentType").Where(predicate);}.....在我的代码中,我使用如下Expression>predicate=PredicateBuilder.True();predicate=