codeFirst实体建表

This commit is contained in:
不做码农
2023-06-09 18:10:38 +08:00
parent b96edfdac7
commit 1af7e778af
8 changed files with 33 additions and 43 deletions

View File

@@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.Filters;
using System.Reflection;
namespace ZR.Admin.WebApi.Extensions
{
@@ -52,9 +53,12 @@ namespace ZR.Admin.WebApi.Extensions
{
//var tempPath = hostEnvironment.ContentRootPath;
//添加文档注释
c.IncludeXmlComments(Path.Combine("ZRAdmin.xml"), true);
c.IncludeXmlComments(Path.Combine("ZRModel.xml"), true);
//c.IncludeXmlComments(Path.Combine(Directory.GetParent(tempPath).FullName, "ZR.Model", "ZRModel.xml"), true);
var baseDir = AppContext.BaseDirectory;
c.IncludeXmlComments(Path.Combine(baseDir, "ZR.Model.xml"), true);
var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
var xmlPath = Path.Combine(baseDir, xmlFile);
c.IncludeXmlComments(xmlPath);
}
catch (Exception ex)
{