Generating model code with Model.edmx in EF6 without Visual Studio

For our application, we do not use Visual Studio in the build process; Visual Studio is not located on build servers. In general, we saved Visual Studio as "pleasant" for application development, but the most important requirements for a reproducible assembly are all open source / freely available.

Now I am considering switching to EF6. I do not want to check the generated model code, so I need a way to create a model from an edmx file without the need for Visual Studio.

We used to use EdmGen because it comes with the .NET platform, and we are pleased that our build servers depend on this. In EF6, the recommended way to generate code is to use T4 templates.

However, T4 code generation tools are built into Visual Studio and are not sent separately.

This question contains part of the answer. However, there are problems with both answers.

First, it is suggested that the license allows you to copy the necessary files to the build server from the Visual Studio installation. However, this is an ugly solution, as it means that setting up a new build server cannot be automated and depends on the presence of the Visual Studio installation. In addition, to generate the EF6 model, we also need EF.Utility.CS.ttinclude in the Visual Studio installation. I have a letter from one of the developers of Microsoft, which says that in his non-legal opinion I will also be allowed to copy this file, but looking at the license, I'm not sure.

-, , MonoDevelop TextTransform . , , include, , , , TextTransform , EF6. , .

: - EF6 , Visual Studio?

+4
1

. , , TextTransform MonoDevelop. , , tt, Entity Framework, . .

, Visual Studio, .

Model.tt #if PREPROCESSED_TEMPLATE GetNamespaceName.

-, include. .

, , , , , TextTransform , - , , / MonoDevelop. Model.tt :

./TextTransform.exe -out Models.cs -I INCLUDES Model.tt

"INCLUDES" - EF.Utility.CS.ttinclude in.

0

All Articles