I have the following sample code:
Context context = new Context();
Repository repository = new Repository(context);
Post post = repository.First<Post>(x => x.Id == 1);
Model model = new Model {
Created = cube.Created,
Id = cube.Id,
Name = cube.Name,
Pack = cube.Pack.Id,
Mimes = context.Files.Where(x => x.Id == 1).Select(x => x.Mime).ToList()
};
I need to find which SQL queries are being sent to the database.
How can I profile the EF queries using SQL Express and VS 2012?
Is there any tool for this?
You have a few options here.
((ObjectQuery)query).ToTraceString()see https://stackoverflow.com/a/7901917/1070291 (I think this only works for queries so may not be the best in the above scenario)