EF Reverse POCO against a SQL Database Project?

前端 未结 2 1269
太阳男子
太阳男子 2021-01-21 22:06

Can I use the EF Reverse POCO generator directly against a SQL Database Project?

I keep my SQL database definition in a \"Visual Studio SQL Database Pro

相关标签:
2条回答
  • 2021-01-21 22:51

    For EntityFramework Reverse POCO Code First Generator, you would need to round-trip through an actual SQL database to generate the code-first code as you cannot use generator against a VS Database Project.

    0 讨论(0)
  • 2021-01-21 22:54

    There is a project called SqlSharpener on GitHub available as a NuGet package.

    Description:

    Parses SQL files to create a meta-object hierarchy with which you can generate C# code such as stored procedure wrappers or Entity Framework Code-First entities. Generate either manually or by invoking one of the included pre-compiled T4 templates.

    Rather than generating code from the database or using a heavy abstraction layer that might miss differences between the database and data access layer until run-time, this project aims to provide a very fast and simple data access layer that is generated at design-time using SQL files as the source-of-truth (such as those found in an SSDT project).

    I cannot vouch for it because I have never used it but it seems promising.

    0 讨论(0)
提交回复
热议问题