2
Reply

How to run a query in database while using Entity framework?

Kavipriya

Kavipriya

6y
3.8k
0
Reply

    Entity Framework allows you to execute raw SQL queries for the underlying relational database.
    Here are some methods used:-
    DbSet.SqlQuery()
    DbContext.Database.SqlQuery()
    DbContext.Database.ExecuteSqlCommand()

    We need to use AsQueryable() along with lambda expression or Linq query.