简体   繁体   中英

EF7 UWP SQLite .Include() method

Want use Entity Framework 7 (Entity Framework Core) with SQLite in Universal Windows Application.

Can`t find .Include(x => x.SomeNvaigationProperty)

.Include() doesn't appear in intellisense

.Include() in System.Data.Entity

System.Data.Entity not available in UWP

What use in UWP (as .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

You are adding wrong namespace using System.Linq for .Include() . You need to add using System.Data.Entity then you will get .Include()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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