czemacleod / c3d.msbuild.tools.ef6.generateviews Goto Github PK
View Code? Open in Web Editor NEWCodebase for an MSBuild based version of the Entity Framework 6 Power Tools Generate Views command
License: MIT License
Codebase for an MSBuild based version of the Entity Framework 6 Power Tools Generate Views command
License: MIT License
We have a DB first context like AcmeContext : DbContext, which is automatically created. We then have a superclass of this with our customisations SuperAcmeContext : AcmeContext. However, the superclass cannot access the generated views because they are sealed.
I think if the views were not sealed OR the DbMappingViewCacheTypeAttribute allowed for a parameterised type then it would work. For example [assembly: DbMappingViewCacheTypeAttribute(SuperAcmeContext,...)
Any ideas if there is a workaround?
Thank you so much for providing this. Not only does it help with not needing the Power Tools anymore, but it also means I don't have to worry about remembering to generate mapping views. Can't tell you how many times I spaced that step and broke the build...
Anyway, now that I have the two entries in my csproj file (EntityView and EntityDeploy), the edmx is duplicated in the Solution Explorer. Am I doing something wrong, is there a way around that, or is that just a side effect we'll have to live with?
<EntityDeploy Include="iMISEntities.edmx">
<Generator>EntityModelCodeGenerator</Generator>
<LastGenOutput>iMISEntities.Designer.cs</LastGenOutput>
</EntityDeploy>
<EntityView Include="iMISEntities.edmx">
<Generator>
</Generator>
<CustomToolNamespace>Model</CustomToolNamespace>
</EntityView>
Thanks again!
~Justin
Any plans on turning this into a C# Source Generator?
I am using code first migrations. In VS2019, I used EF Power Tools to give me an Entity Framework menu on my DBContext class file in the solution explorer.
When I selected Generate Views, it would take about a minute to generate the views. The result was a DBContext.Views.cs file added to the project.
Since EF Power Tools isn't available for VS2022, I am trying to migrate to your build tool. It sounds great but I am not sure I have it installed properly.
Here is what I did:
Everything went well, but I am not sure that that the Views were created. I have no .edmx in my solution view. And when I did the Udpate-Database, it took about 2 seconds where normally view generation takes about 60 seconds.
I looked in the obj directory for SkyCourt and I do not see anything called EntityViews.
Did I miss something?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.