Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dapper.NET and IQueryable

Tags:

c#

lambda

dapper

Is there a plan to make Dapper.net compatible with IQueryable interfaces? If not, what's the workaround to use Dapper with "Expression Trees" filters?

like image 388
Bill Avatar asked Dec 19 '14 09:12

Bill


People also ask

Does dapper use IQueryable?

yes, but you can use the IQueryable version to bind, for example GridView in Asp.net and benefit for sorting (you can't sort using IEnumerable version). Sure, it's pretending to be an IQueryable object, but we all know it isn't and AFAIK the benefits of a real IQueryable do not apply if you mock it, right?

Can we use dapper and Entity Framework together?

To demonstrate the usage of Dapper, Entity Framework Core, and both combined, we will implement them each in the 3 Endpoints. For the GetAll Endpoints, we will use Dapper. The GetById Endpoint would use Entity Framework Core with Eager Loading to display the Department Details as well.

Can I use LINQ with dapper?

Dapper Plus LINQ DynamicYou can execute query dynamically through the Eval-Expression.NET library. The Eval-Expression.NET library can be activated with the Dapper Plus license.

What is an IQueryable?

IQueryable<T> is a C# interface that lets you query different data sources. The type T specifies the type of the data source that you're querying. Under the hood, IQueryable uses expression trees that translate LINQ queries into the query language for the data provided.


1 Answers

No, there are no plans to do this. It is far far outside what dapper tries to do. So far that I would say it is antithetical. Dapper core tries to be the friend to those who love their SQL.

like image 111
Marc Gravell Avatar answered Sep 30 '22 19:09

Marc Gravell