手机网站弹出导航菜单,手机网站模板 餐饮,五金公司宣传册设计样本,万网域名注册官网gnameDbTool 2.0.0 ReleasedIntroDbTool 一个支持 DbFirst、ModelFirst 和 CodeFirst 的数据库小工具。DbFirst 是根据数据库中的表信息生成代码中的 Model#xff0c;以及生成数据表结构文档ModelFirst 是根据数据表信息或者数据表结构文档生成创建数据库的脚本CodeFirst 是指根据… DbTool 2.0.0 ReleasedIntroDbTool 一个支持 DbFirst、ModelFirst 和 CodeFirst 的数据库小工具。DbFirst 是根据数据库中的表信息生成代码中的 Model以及生成数据表结构文档ModelFirst 是根据数据表信息或者数据表结构文档生成创建数据库的脚本CodeFirst 是指根据 model 代码生成数据库表结构信息以及创建数据表的 SQL 脚本在新的版本中主要增加对于一些新的 C# 特性的支持全局引用文件范围命名空间可空引用类型FeaturesDb First本次更新主要针对于 C# 的新特性做了一些支持可空引用类型是 C# 8 开始引入的特性启用之后默认引用类型也是不可为空的比如说 string 是不可为 null 的如果要允许为 null 则应声明为 string?而数据库中字段一般是会区分是否允许为 null 的和这一特性就会比较契合efcore 6 开始也会根据是否可以为空生成是否可为空的数据库列。全局引用和文件范围命名空间是 C# 10 引入的新特性不了解的小伙伴可以参考之前的介绍文章 C# 10 新特性 —— 命名空间的变化DbFirst以上数据表导出的代码示例namespace Models;public class Notice
{public Guid NoticeId { get; set; }public string NoticeTitle { get; set; }public string? NoticeDesc { get; set; }public string? NoticeContent { get; set; }public string? NoticePath { get; set; }public string? NoticeExternalLink { get; set; }public string? NoticeImagePath { get; set; }public string? NoticeCustomPath { get; set; }public int NoticeVisitCount { get; set; }public DateTime UpdateTime { get; set; }public string UpdateBy { get; set; }public DateTime NoticePublishTime { get; set; }public string NoticePublisher { get; set; }public bool CheckStatus { get; set; }public bool IsDeleted { get; set; }
}允许为 null 的字段就会声明为可为空的引用类型如 string?在导出方面默认支持了导出 csv 文档Model FirstModelFirstModelFirst 在原来的基础上集成了 Csv 文档的导入Code First我们可以从一个 C# model 代码提取出其中的属性来生成数据库的表结构生成不同数据库的创建表的脚本CodeFirstSettingsSettings最后配置页面增加了针对新的选项的默认配置More更多实现细节以及自定义可以查看和修改源码你也可以根据需要自定义自己的插件可以参考https://github.com/WeihanLi/DbTool.Packages/blob/main/README.mdReferenceshttps://github.com/WeihanLi/DbToolhttps://github.com/WeihanLi/DbTool.Packages数据库小工具 DbTool.NET 6 中的隐式命名空间引用C# 10 新特性 —— 命名空间的变化