修改美国正式配置文件
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-09-05 15:51:30 +08:00
parent 0d5d5105ce
commit a8f6594142
3 changed files with 53 additions and 16 deletions
+21 -15
View File
@@ -47,25 +47,31 @@ partial class Program
}
#endregion
using (var context = new YourDbContext())
#region
var contextOptions = new DbContextOptionsBuilder<IRaCISDBContext>().UseSqlServer(@"Server=106.14.89.110,1435;Database=Test_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true").Options;
using var dbContext = new IRaCISDBContext(contextOptions);
var dbModel = dbContext.Model;
foreach (var entityType in dbModel.GetEntityTypes())
{
var model = context.Model;
string tableName = entityType.GetTableName();
Console.WriteLine($"Table: {tableName}");
foreach (var entityType in model.GetEntityTypes())
foreach (var property in entityType.GetProperties())
{
string tableName = entityType.GetTableName();
Console.WriteLine($"Table: {tableName}");
string columnName = property.GetColumnName();
string dataType = property.ClrType.Name;
bool isNullable = property.IsNullable;
foreach (var property in entityType.GetProperties())
{
string columnName = property.GetColumnName();
string dataType = property.ClrType.Name;
bool isNullable = property.IsNullable;
Console.WriteLine($" Column: {columnName}, Data Type: {dataType}, Is Nullable: {isNullable}");
}
Console.WriteLine($" Column: {columnName}, Data Type: {dataType}, Is Nullable: {isNullable}");
}
}
#endregion
// 要生成的表名数组
@@ -77,7 +83,7 @@ partial class Program
foreach (var templateFilePath in Directory.GetFiles(templateFolderPath))
{
var fileName=Path.GetFileNameWithoutExtension(templateFilePath);
var fileName = Path.GetFileNameWithoutExtension(templateFilePath);
//模板放入具体的文件夹
//var folder = fileName == "Entity" ? "Entity" : fileName.Replace("Entity", "");
@@ -142,7 +148,7 @@ partial class Program
//删除主键属性名
public string LowercaseTableNameId => char.ToLower(TableName[0]) + TableName.Substring(1) + "Id";
public string LowercaseRepositoryName => $"_{char.ToLower(TableName[0]) + TableName.Substring(1)}Repository" ;
public string LowercaseRepositoryName => $"_{char.ToLower(TableName[0]) + TableName.Substring(1)}Repository";
public string LowercaseQueryableName => $"{char.ToLower(TableName[0]) + TableName.Substring(1)}Queryable";