随笔- 672
文章- 2
评论- 325
阅读-
281万
08 2024 档案
C#中的try catch finally(链接)
摘要:下面这篇微软的官方文档,详细讲述了C#中如何使用try catch finally来处理异常: Exception-handling statements - throw, try-catch, try-finally, and try-catch-finally 其中这个地方有说到,不管是在try
阅读全文
EF Core Keys(链接)
摘要:下面这篇微软的官方文档详细介绍了如何给EF Core的实体类定义Key: Keys 注意,其中的Configuring a primary key还介绍了如何使用Fluent API,来用多个字段给实体类定义组合Key: protected override void OnModelCreating
阅读全文
EF Core使用SharedTypeEntity,映射实体类到不同的数据库表(转载)
摘要:我们可以借助EF Core的SharedTypeEntity,映射一个实体类到多个结构相同的数据库表: public class User { public int Id { get; set; } public string Name { get; set; } } public class So
阅读全文