IPluralizer, where to find?

旧时模样 提交于 2021-01-27 11:23:29

问题


I have Dal classes in my applications, that use database scaffolding for EF database fist. In order to singuarlize / pluralize the tables the right way, I wrote my own custom pluralizer by implementing IPluralizer found in Microsoft.EntityFrameworkCore.Design namespace. This works fine in my .Net Core 2.2 applications.

Since the present release of .Net Core 3.0 I tried to rewrite all my applications. Most of my projects work fine with .Net Core 3.0, but for my Dal projects I'm not able to locate the IPluralizer interface.

How do I use database scaffolding and get the entities pluralized the right way in my .Net Core 3.0 Dal projects?


回答1:


After a little Googling around I stumbled across this article, that describes the problem and how to get it working.

https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-3.0/breaking-changes#microsoftentityframeworkcoredesign-is-now-a-developmentdependency-package

Since the Microsoft.EntityFrameworkCore.Design namespace has changed to an Development Dependency Package, you have to modify your project file (.csproj) and comment out the section in order to allow compile against the namespace.

<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.0.0">
   <PrivateAssets>all</PrivateAssets>
   <!--<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>-->
</PackageReference>


来源:https://stackoverflow.com/questions/58276505/ipluralizer-where-to-find

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!