T4 alternative in .NET Core?

You could use Scripty. It looks quite nice and fits with the new Analyzers from Roslyn. http://daveaglick.com/posts/announcing-scripty https://github.com/daveaglick/Scripty Since they are dropping the project.json format (https://blogs.msdn.microsoft.com/dotnet/2016/05/23/changes-to-project-json/) you should be able to use Scripty from the .xproj or .csproj file.

How to simplify repeating if-then-assign construction?

You have a case of temporal coupling there, i.e. you’re mixing the check whether the entity has changed with the assignments. If you separate the two, your code becomes much cleaner: protected override bool ModifyExistingEntity(Product entity, ProductModel item) { bool isModified = this.IsEntityModified(entity, item); if (isModified) { this.UpdateEntity(entity, item); } return isModified; } private bool … Read more

Comments in T4 Templates

To include comments as part of control code, they need to be inside a code block of some sort, for example <# // Hello this is a comment #> or <#+ // Hello this is a comment in a class feature block #> Sometimes you need to push the close tag to the next line … 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