繁体   English   中英

EF7 UWP SQLite .Include()方法

[英]EF7 UWP SQLite .Include() method

想要在通用Windows应用程序中将Entity Framework 7(Entity Framework Core)与SQLite一起使用。

找不到.include(x => x.SomeNvaigationProperty)

.include()不会出现在智能感知中

System.Data.Entity中的.include()

System.Data.Entity在UWP中不可用

在UWP中(如.Include())有什么用?

public class Parent
{
   public Guid Id { get; set; }
   public List<Child> Childs { get; set; }
}

public class Child
{
   public Guid Id { get; set; }
   public Guid ParentId { get; set; }
   public Parent Parent { get; set; }
}

dbContext.Parent.Include(x => x.Childs).ToList();
dbContext.Childs.Include(x => x.Parent).ToList();

在此处输入图片说明

在Entity Framework 7中, Include()放置了Microsoft.EntityFrameworkCore

您正在using System.Linq for .Include()添加错误的名称空间。 您需要using System.Data.Entity添加,然后您将获得.Include()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM