开发者

EntityFramework and MySQL with LINQ

开发者 https://www.devze.com 2023-01-12 03:38 出处:网络
I\'m trying to use EntityFramework to work with MySQL database from c#. I\'m using MySQL Connector 6.3.3, but i\'m unable to use the linq syntax like

I'm trying to use EntityFramework to work with MySQL database from c#. I'm using MySQL Connector 6.3.3, but i'm unable to use the linq syntax like

context.Items.Where(x => x.Id == 3)

I only see the following overload for Where:

Where(string predicate, params ObjectParameter[] parameters);

Is there a provide开发者_如何学JAVAr or something that could help me to work with MySQL from EF with the common LINQ syntax?


You're probably missing a using clause :

using System.Linq;

You also need to reference the System.Core assembly.

The Where method you're seeing is the one defined by the ObjectSet<T>. The other query operators are extension methods defined in the System.Linq.Queryable class

0

精彩评论

暂无评论...
验证码 换一张
取 消