Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EF 6 - Include Why Do I not have linq choice?

I am a bit confused on why I don't get linq.

context.Users.Include(x => x.Roles)

I can't do this I have to do context.Users.Include("Roles")

Seems like other people can do it.

EF Code first Eager loading and OrderBy problem

Do I need to import something? Has something changed in EF 6(rc1)?

like image 525
chobo2 Avatar asked Oct 18 '13 22:10

chobo2


People also ask

Does Entity Framework support LINQ?

Entity framework is a great ORM shipped by Microsoft which allow you to query and modify RDBMS like SQL Server, Oracle, DB2 and MySQL etc. by using LINQ syntax.

What is the difference between EF and LINQ?

Entity Framework is an object-relational mapping (ORM) framework for connecting C# code to external databases, usually SQL Server. LINQ is a query language embedded into C# and a set of extension methods in order to make it useful.

Does EF core 6 require .NET 6?

NET Framework versions will need to target . NET 6 to use EF Core 6.0.

Which of the features is are now supported in EF Core 6?

EF Core now supports: The creation of temporal tables using Migrations. Transformation of existing tables into temporal tables, again using Migrations. Querying historical data.


1 Answers

If you're using DbContext, the correct namespace to import is:

using System.Data.Entity;

This is the namespace that contains DbExtensions that provides the type-safe versions of the .Include method.

like image 114
Kirk Woll Avatar answered Sep 25 '22 13:09

Kirk Woll