YOUSFI Mohamed Walid
YOUSFI Mohamed Walid

Reputation: 580

Database query filtering in ASP.Net core web api

I am creating a web API in ASP.net core for my angular frontend and right now I have implemented a filtering feature on my frontend page where the users can filter and sort the data using any field, with regex filters, and also allow the user to only show a number of elements on each page. the problem with this is that: every time I have to send all the data from my backend which won't come in handy when I have a big database, so I must do the filtering, ordering, and paging on my backend depending on what the user requested from the front. How's this problem usually solved? are there known technics for doing this?

Upvotes: 1

Views: 1151

Answers (1)

Dmitry Grebennikov
Dmitry Grebennikov

Reputation: 434

You have a lot of options for that:

  1. Use Dapper. It's great solution for query, filter, arrange data. Link to documentation - Dapper documentation
  2. Use Entity Framework Core or other ORM. But first you need to create a model from your existing database. Link to documentation - EF Core documentation
  3. Use ADO.Net. It's a proprietary way to access SQL database for .NET solutions. Link to documentation - ADO.Net docmentation

I hope it will help you to quick query and filter your data on backend side.

Upvotes: 2

Related Questions