Browse Source

暂时屏蔽SnakeToCamelCase,只有netcore7.0才支持

bjmzak
DESKTOP-G961P6V\Zhh 2 years ago
parent
commit
20d65e8c1f
  1. 2
      src/Shentun.Peis.EntityFrameworkCore/EntityFrameworkCore/PeisDbContext.cs
  2. 4
      src/Shentun.Peis.EntityFrameworkCore/EntityFrameworkCore/SnakeToCamelCase.cs

2
src/Shentun.Peis.EntityFrameworkCore/EntityFrameworkCore/PeisDbContext.cs

@ -491,7 +491,7 @@ public class PeisDbContext :
#endregion
//将驼峰名改成小写+下划线形式,比如AsbitemDetails改成asbitem_details
builder.ToSnakeCase();
//builder.ToSnakeCase();
#region 测试
builder.Entity<HelloA>(entity =>

4
src/Shentun.Peis.EntityFrameworkCore/EntityFrameworkCore/SnakeToCamelCase.cs

@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using System;
using System.Collections.Generic;
using System.Linq;
@ -8,6 +9,7 @@ using System.Threading.Tasks;
namespace Shentun.Peis.EntityFrameworkCore
{
/*
public static class SnakeToCamelCase
{
[Flags]
@ -49,6 +51,7 @@ namespace Shentun.Peis.EntityFrameworkCore
if (convertAll || convertProperties)
foreach (var property in entity.GetProperties())
{
property.SetColumnName(property.GetColumnName().ToSnakeCase());
}
@ -74,4 +77,5 @@ namespace Shentun.Peis.EntityFrameworkCore
}
}
*/
}
Loading…
Cancel
Save