Linked Questions

69 votes
8 answers
102k views

I'm using EF 6.0 with LINQ in MVC 5 project. I want to log all the SQL queries executed by the Entity Framework DbContext for debugging/performance-measurement purpose. In Java/Hibernate, equivalent ...
PC.'s user avatar
  • 7,042
30 votes
3 answers
49k views

How can I get the sql script generated by an entity framework query? i.e. If I write entityDataDontext.table1.Where(r => r.primarykey == 1).First(); then how can I get the SQL which should be ...
Gaurav Pandey's user avatar
2 votes
1 answer
335 views

I know you can access the raw SQL generated by Linq To Sql, but is it possible to use Linq To Entities to build a query and then access to generated SQL? The reason I need to do this is because I ...
Crimson7's user avatar
-1 votes
1 answer
238 views

I would like to know how I could see the SQL command when I use the saveChanges method in Entity Framework. I am using EF 4.4. Thanks.
Álvaro García's user avatar
221 votes
10 answers
222k views

I am using Entity Framework Core and I need to see which SQL code is being generated. In previous versions of Entity Framework I could use the following: string sql = ((System.Data.Objects....
Miguel Moura's user avatar
105 votes
10 answers
369k views

I'm using generic repository pattern in asp.net core 2.0 which can not dispose repository object, when I am going to update the entry its updated for one time successfully but when I am trying to ...
Ali Raza's user avatar
  • 1,281
92 votes
8 answers
92k views

According this thread, we can log the generated SQL via EF, but what about DbContext.SaveChanges()? Is there any easy way to do this job without any extra frameworks?
Masoud's user avatar
  • 8,246
78 votes
9 answers
107k views

How is it done using the ObjectQuery method?
nellbryant's user avatar
  • 3,169
49 votes
5 answers
46k views

I am using Entity Framework to build an web application, the database is created on startup and my seed method adds some entities to the database without any problem. Also the retrieve of the entities ...
janhartmann's user avatar
58 votes
4 answers
131k views

I have a query which I am passing byte[] as a parameter. I am trying to get the SQL query out of it and run that query in management studio to debug. How can I extract the SQL statement from it? ...
James123's user avatar
  • 11.7k
25 votes
5 answers
41k views

I'm trying to make a stackoverflow clone in my own time to learn EF6 and MVC5, i'm currently using OWin for authentication. Everything works fine when i have like 50-60 questions, i used Red Gate ...
Lee Gary's user avatar
  • 2,417
18 votes
5 answers
8k views

Is it possible to step into a linq query? I have a linq to entity framework 4 query in it's simplest form: List = List.Where(f => f.Value.ToString().ToLowerInvariant().Contains(filter....
MyNameIsJob's user avatar
  • 2,528
20 votes
5 answers
4k views

In LINQ-to-Entities you can query entities by doing: var students = SchoolContext.Students.Where(s => s.Name == "Foo" && s.Id == 1); I know that behind the scenes it will be translated to ...
rexcfnghk's user avatar
  • 15.7k
12 votes
3 answers
20k views

I'm having some 'tear my hair out'-problem with Entity Framework and I just can't find a solution. What I want to do is compare strings for a search function I'm running on the server. It's basically:...
Robin Dorbell's user avatar

15 30 50 per page
1
2 3 4 5
9