This commit is contained in:
+29
-24
@@ -17,42 +17,46 @@ partial class Program
|
||||
//发布的目录和项目的目录有区别的
|
||||
var rootPath = AppContext.BaseDirectory.Replace(@"\bin\net8.0\", "").Replace(@"\bin\Release\net8.0\", "");
|
||||
|
||||
var templateFolderPath = Path.Combine(rootPath, "Template");
|
||||
var outPutTemplateFolderPath = Path.Combine(rootPath, "TemplateOutPut");
|
||||
var templateFolderPath = Path.Combine(rootPath, "LiquidTemplate");
|
||||
var outPutTemplateFolderPath = Path.Combine(rootPath, "LiquidTemplateOutPut");
|
||||
|
||||
#region 生成文件目录准备
|
||||
if (!Directory.Exists(outPutTemplateFolderPath))
|
||||
{
|
||||
Directory.CreateDirectory(outPutTemplateFolderPath);
|
||||
}
|
||||
var servicePath = Path.Combine(outPutTemplateFolderPath, "Service");
|
||||
var iServicePath = Path.Combine(outPutTemplateFolderPath, "IService");
|
||||
var entityPath = Path.Combine(outPutTemplateFolderPath, "Entity");
|
||||
var dtoPath = Path.Combine(outPutTemplateFolderPath, "DTO");
|
||||
|
||||
if (!Directory.Exists(servicePath))
|
||||
{
|
||||
Directory.CreateDirectory(servicePath);
|
||||
}
|
||||
if (!Directory.Exists(iServicePath))
|
||||
{
|
||||
Directory.CreateDirectory(iServicePath);
|
||||
}
|
||||
if (!Directory.Exists(entityPath))
|
||||
{
|
||||
Directory.CreateDirectory(entityPath);
|
||||
}
|
||||
if (!Directory.Exists(dtoPath))
|
||||
{
|
||||
Directory.CreateDirectory(dtoPath);
|
||||
}
|
||||
#region 废弃 没必要分目录,还是手动设置文件夹
|
||||
//var servicePath = Path.Combine(outPutTemplateFolderPath, "Service");
|
||||
//var iServicePath = Path.Combine(outPutTemplateFolderPath, "IService");
|
||||
//var entityPath = Path.Combine(outPutTemplateFolderPath, "Entity");
|
||||
//var dtoPath = Path.Combine(outPutTemplateFolderPath, "DTO");
|
||||
|
||||
//if (!Directory.Exists(servicePath))
|
||||
//{
|
||||
// Directory.CreateDirectory(servicePath);
|
||||
//}
|
||||
//if (!Directory.Exists(iServicePath))
|
||||
//{
|
||||
// Directory.CreateDirectory(iServicePath);
|
||||
//}
|
||||
//if (!Directory.Exists(entityPath))
|
||||
//{
|
||||
// Directory.CreateDirectory(entityPath);
|
||||
//}
|
||||
//if (!Directory.Exists(dtoPath))
|
||||
//{
|
||||
// Directory.CreateDirectory(dtoPath);
|
||||
//}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
// 要生成的表名数组
|
||||
var tableNames = new List<string> { /*"Subject", "Order"*/ };
|
||||
var tableNames = new List<string> { "Subject", "Order" };
|
||||
|
||||
try
|
||||
{
|
||||
@@ -234,7 +238,8 @@ partial class Program
|
||||
|
||||
public void CheckCodeFirst()
|
||||
{
|
||||
var contextOptions = new DbContextOptionsBuilder<IRaCISDBContext>().UseSqlServer(@"Server=106.14.89.110,1435;Database=Test_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true").Options;
|
||||
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user