IPluralizer,在哪里找到? [英] IPluralizer, where to find?

查看:87
本文介绍了IPluralizer,在哪里找到?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序中有Dal类,这些类使用EF数据库拳头的数据库支架.为了正确地对表格进行加倍/复数处理,我通过实现Microsoft.EntityFrameworkCore.Design命名空间中的IPluralizer编写了自己的自定义复数器.在我的.Net Core 2.2应用程序中,这可以很好地工作.

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.

自从当前版本的.Net Core 3.0开始,我试图重写我的所有应用程序.我的大多数项目都可以在.Net Core 3.0上正常运行,但是对于我的Dal项目,我无法找到IPluralizer界面.

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.

如何在.Net Core 3.0 Dal项目中使用数据库支架并以正确的方式使实体复数?

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

推荐答案

经过一番谷歌搜索后,我偶然发现了这篇文章,它描述了问题以及如何使其工作.

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

由于Microsoft.EntityFrameworkCore.Design命名空间已更改为开发依赖包",因此您必须修改项目文件(.csproj)并注释掉该部分,以允许根据该命名空间进行编译.

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>

这篇关于IPluralizer,在哪里找到?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆