.net - 如何在 as.net core EFCore 3 中使用复数 DbSet 属性名称搭建 DbContext?
问题描述
我如何在asp.net core EFCoreDbContext
3 中使用复数DbSet
属性名称搭建脚手架?并且如果它们在表名中存在多个大写字母(例如 AutoShipment),它会生成除第一个小写字母之外的所有字母(例如 Autoshipment.cs)
解决方案
救生员,最简单的方法:
在 dbContext 项目中安装这个 NUGET 包: Bricelam.EntityFrameworkCore.Pluralizer ,这是他的源代码: https ://github.com/bricelam/EFCore.Pluralizer
它适用于 .net core 3.1,(对于 .net 5 或更高版本不需要它)
推荐阅读
- python-3.x - 开始日期是当月的第一天,结束日期是下个月的第一天 Pandas
- python - 根据来自另一个 DataFrame 的值从一个 DataFrame 中选择行
- python - 在 Python 中将 .csv 文件命名为“From Time1 to Time2.csv”
- java - 如何使用 Jms.messageDrivenChannelAdapter 测试 IntegrationFlow
- paypal - 我的应用内钱包需要任何财务证明吗?
- bash - 如何在 while 读取循环中以交互方式使用 rm?
- php - 调用函数包括将 php 文件放入另一个 php 文件的文件夹 - Wordpress 插件
- regex - 带有空行的正则表达式#ifdef
- discord.py - 有什么可以使 discord.py 中的 on_member_join 起作用吗?
- python - 从函数体内调用时正确分配的值,在 pytest 运行时失败