diff --git a/notes/helloshop/efcore-naming-conventions.md b/notes/helloshop/efcore-naming-conventions.md index abada0a..5e28323 100644 --- a/notes/helloshop/efcore-naming-conventions.md +++ b/notes/helloshop/efcore-naming-conventions.md @@ -2,6 +2,17 @@ 不同数据库对象的命名约定不同,EF Core 为了适配不同数据库,提供了一些命名约定的配置选项。 +## 常见的命名方法 + +| Naming policy | Original | Converted | +|----------------|--------------|--------------| +| PascalCase | HelloShop | HelloShop | +| CamelCase | HelloShop | helloShop | +| SnakeCaseLower | HelloShop | hello_shop | +| SnakeCaseUpper | HelloShop | HELLO_SHOP | +| KebabCaseLower | HelloShop | hello-shop | +| KebabCaseUpper | HelloShop | HELLO-SHOP | + ## 手动指定表名和列名 ### 表名 diff --git a/notes/helloshop/use-time-provider.md b/notes/helloshop/use-time-provider.md index 121f824..a2b1697 100644 --- a/notes/helloshop/use-time-provider.md +++ b/notes/helloshop/use-time-provider.md @@ -37,7 +37,7 @@ public class MyTimeProvider : TimeProvider 默认实现 TimeProvider.System 使用系统时间。 ```csharp -builder.Services.AddSingleton(TimeProvider.System); +builder.Services.AddSingleton(TimeProvider.System); ``` 注入 MyTimeProvider 使用自定义时间。