EntityFramework-Reverse-POCO-Code-First-Generator
EntityFramework-Reverse-POCO-Code-First-Generator copied to clipboard
Multi-targeting
From @TimSirmovics
I am playing around with a library that multi targets .NET Standard 2.0 and .NET Framework 4.72, using EF Core for the .NET Standard version and EF 6 for the .NET Framework version. I put two version of the generator (Ef6 and EfCore) in the same folder and set GenerateSeparateFiles = false so that all of the entities would generate with the same namespace (I could also put them in a seperate folder and set the namespace but this was ok for now). After generation I would wrap the entire generated file in #if NETSTANDARD2_0 and #if NET472 blocks respectively which seemed to work ok. The only issue is I had to manually re-add these after each regeneration. I'm not sure if this is a common requirement but is it possible to add an option specifing .NET targets for the output file(s)?
Have the same issue, at the moment im editing the ttinclude so that when the template is EFCore3 it adds the #if NETSTANDARD2.0 and when the template is EF6 it adds #if NET472 but a way to specify #if wappers in the tt would be very helpful