哪里可以找到IPluralizer? [英] Where to find IPluralizer?

查看:29
本文介绍了哪里可以找到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.

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

由于 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天全站免登陆