FindAsync with non-primary key value
var foos = await db.Foos.Where(x => x.UserId == userId).ToListAsync();
Read more →var foos = await db.Foos.Where(x => x.UserId == userId).ToListAsync();
Read more →If you are working from an EF context, the context has its own LOG. This can be written out to your development console (see example below). context.Log =…
Read more →Ever wanted to reverse engineer a code-first Entity framework model ? Or simply generate a diagram from an existing model? Try the Entity Framework Power Tools. Power…
Read more →Suppose you are stuck with a namevaluecollection – it is not of type IQueryable or IEnumerable. So – none of your LINQ queries will work on it. Convert…
Read more →Open the EDMX file within Visual Studio – use an Open With command from the right click menu Open With -> ADO.NET Entity Data Model Designer Right click…
Read more →LINQPad, the most popular LINQ tool out there , does not convert SQL statements into their equivalent LINQ syntax. However, a free tool called Linqer does just that.…
Read more →Several quirks may pop up – the project may not work seamlessly in your local environment. Entity Framework generates a slew of files – most notably its mapping…
Read more →In your folder structure, where shoul you put the edmx data folder? As all EDMX files are representations (abstractions) of some relational database, they belong in the Models…
Read more →1. To get started with this powerful profiler, simply install the NuGet package (look for nHibernate Profiler). 2.Installing it places all the required assemblies in…
Read more →Introduction The same rollback considerations that apply to normal SQL transactions also apply to nHibernate transactions. Rollback Scenario Suppose you have two SQL Statements – the first one…
Read more →