No executable found matching command “dotnet-ef”

Entity Framework Core 1.0 You should just need to update the tools section of your project.json file to include this: “Microsoft.EntityFrameworkCore.Tools”: { “version”: “1.0.0-preview1-final”, “imports”: [ “portable-net45+win8+dnxcore50”, “portable-net45+win8” ] } This should make the dotnet ef commands available. Important I should also note here that the dotnet ef commands will only be available when running … Read more

ADO.NET DbContext Generator vs. ADO.NET Poco Entity Generator (ObjectContext)

From a point of view of clean creation of POCO entities, there is no difference between the two generators. Both generators produce the same entities, however, ADO.NET POCO Entity Generator is based on ObjectContext‘s API, whereas ADO.NET DbContext Generator is based on DbContext‘s API. DbContext’s API has a few very nice new features (Local, Query … Read more

Should I enable or disable dynamic proxies with entity framework 4.1 and MVC3?

If you talk about dynamic proxies in EF there are two different types to distinguish: Proxies for lazy loading Proxies for change tracking Usually a change tracking proxy also can serve as a proxy for lazy loading. The reverse is not true. This is because the requirements for change tracking proxies are higher, especially all … Read more

Improve navigation property names when reverse engineering a database

There a few things you need to change inside the .tt file. I choose to use the third solution you suggested but this requires to be formatted like FK_CollectionName_RelationName. I split them up with ‘_’ and use the last string in the array. I use the RelationName with the ToEndMember property to create a property … Read more

EntityFramework code-first custom connection string and migrations

If your migration does not work correctly try to set Database.Initialize(true) in DbContext ctor. public CustomContext(DbConnection connection) : base(connection, true) { Database.Initialize(true); } I have similar problem with migrations. And in my solution I have to always set database initializer in ctor, like below public CustomContext(DbConnection connection) : base(connection, true) { Database.SetInitializer(new CustomInitializer()); Database.Initialize(true); } … Read more