Metadata file not found – Data.Entity.Model

Based on C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\EF6.Utility.CS.ttinclude , the code generator is looking for the missing DLLs in the following locations: <#@ assembly name=”%VS120COMNTOOLS%..\IDE\EntityFramework.dll” #> <#@ assembly name=”%VS120COMNTOOLS%..\IDE\Microsoft.Data.Entity.Design.dll” #> I discovered that the environment variable %VS120COMNTOOLS% is not compatible with the correct installation path of visual studio, so I changed it from … Read more

Columns of two related database tables in one ASP.NET GridView with EntityDataSource

OK, much too many hours later I found the solution myself: Option 1: It is possible to use the select property in the EntityDataSource which allows to create arbitrary projections of data from several related entities/database tables (in my case: OrderID from Order entity and City from the Address entity) Drawback: Using select in the … Read more

Entity Framework 4: Does it make sense to create a single diagram for all entities?

Having one big EDM containing all the entities generally is NOT a good practice and is not recommended. Using one large EDM will cause several issues such as: Performance Issue in Metadata Load Times: As the size of the schema files increase, the time it takes to parse and create an in-memory model for this … Read more

Entity framework: StoreGeneratedPattern=”Computed” property

Setting this property to Computed is telling EF that you cannot set the value directly. How could you? This property exists for the sake of computed columns, which by definition are not saved back to the database. Unfortunately, EF’s “Default Value” property can only be set to values known at compile-time, and so not DateTime.Now … Read more

Can’t Create Entity Data Model – using MySql and EF6

I just had the same situation when trying to configure Visual Studio Professional 2017 environment with MySQL, ADO.NET (Database First) and EF6. Note: Please follow steps in the same order. Uninstall/remove “Connector/NET” and “MySQL for Visual Studio” if installed. Install “MySQL for Visual Studio” v2.0.5 CTP (MySQL for Visual Studio). Note: Install MySQL for Visual … Read more