Filtering datagrid for T-SQL

Hi guys,

I need to filter datagrid server-side using ORM Dapper, or RAW SQL,

however the datagrid LoadDataArgs returns me in a standard that would be used by the entity only, is there any way to convert the datagrid filter to T-SQL, so I can add it to my query

Hi @Maasaki,

Usually this is done by the query provider of the IQueryble. If your ORM mapper supports IQueryble like Entity Framework everything will work automatically. There is no built-in way to get the raw SQL from LoadData event argument since it is different for every database.

Hi @enchev

It can be a point of improvement, an option to pass a literal.

There seems to be an inordinate amount of reliance on IQueryable, and an assumption that users are using Entity Framework (EF). I don't think that the first is a good thing nor is the second a safe assumption, as many developers (myself among them) are forgoing EF for a faster more streamlined mapper (such as Dapper) when we are using a mapper at all.

Hey @rik,

Radzen will expose data in two ways mainly: EF DbContext and OData service - that’s why the DataGrid component can work out of the box with both.

In fact all demos use EF and IQueryable (which is not related to EF at all and can be used with regular objects and other ORM providers).

We love and rely heavily on IQueryable. It is a built-in feature of .NET and we think there is no good reason not to use it. It is OK to disagree though - just be aware that we will continue using IQueryable and EF in our demos and documentation.

We won't be adding Dapper documentation - we believe EF is a good default choice. If this does not resonate with your beliefs consider picking a different vendor for your Blazor component needs.