修复codefirst

This commit is contained in:
陈淳
2022-10-19 19:10:48 +08:00
parent 9aaf363584
commit 0755a4026a
15 changed files with 34 additions and 32 deletions

View File

@@ -159,9 +159,6 @@ ServiceLocator.Instance = app.Services;
//<2F><><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3>ע<EFBFBD><D7A2>
#endregion
app.UseDeveloperExceptionPage();
#region
//Swagger<65><72><EFBFBD><EFBFBD>ע<EFBFBD><D7A2>
#endregion
app.UseSwaggerService();
}
#region

View File

@@ -8,6 +8,6 @@ namespace Yi.Framework.Model.Models
public partial class ArticleEntity:IBaseModelEntity
{
[Navigate(NavigateType.OneToOne,nameof(UserId))]
public UserEntity User { get; set; }
public UserEntity? User { get; set; }
}
}

View File

@@ -11,10 +11,10 @@ namespace Yi.Framework.Model.Models
public partial class CategoryEntity:IBaseModelEntity
{
[SugarColumn(IsIgnore = true)]
public List<CategoryEntity> Children { get; set; }
public List<CategoryEntity>? Children { get; set; }
[Navigate(NavigateType.OneToMany,nameof(SpecsGroupEntity.CategoryId))]
public List<SpecsGroupEntity> SpecsGroups { get; set; }
public List<SpecsGroupEntity>? SpecsGroups { get; set; }
}
}

View File

@@ -25,14 +25,14 @@ namespace Yi.Framework.Model.Models
var r = new VueRouterModel();
r.OrderNum = m.OrderNum ?? 0;
var routerName = m.Router.Split("/").LastOrDefault();
var routerName = m.Router?.Split("/").LastOrDefault();
r.Id = m.Id;
r.ParentId = (long)m.ParentId;
r.ParentId = m.ParentId??-1;
//开头大写
r.Name = routerName.First().ToString().ToUpper() + routerName.Substring(1);
r.Name = routerName?.First().ToString().ToUpper() + routerName?.Substring(1);
r.Path = m.Router;
r.Hidden = (bool)!m.IsShow;
r.Hidden =!m.IsShow??false;
if (m.MenuType == MenuTypeEnum.Catalogue.GetHashCode())
@@ -62,9 +62,9 @@ namespace Yi.Framework.Model.Models
{
Title = m.MenuName,
Icon = m.MenuIcon,
NoCache = (bool)!m.IsCache
NoCache = !m.IsCache??true
};
if ((bool)m.IsLink)
if (m.IsLink??false)
{
r.Meta.link = m.Router;
r.AlwaysShow = false;

View File

@@ -77,6 +77,6 @@ namespace Yi.Framework.Model.Models
/// 图片列表
///</summary>
[SugarColumn(ColumnName="Images",IsJson = true)]
public List<string> Images { get; set; }
public List<string>? Images { get; set; }
}
}

View File

@@ -10,9 +10,9 @@ namespace Yi.Framework.Model.Models
{
[Navigate(typeof(RoleMenuEntity),nameof(RoleMenuEntity.RoleId),nameof(RoleMenuEntity.MenuId))]
public List<MenuEntity> Menus { get; set; }
public List<MenuEntity>? Menus { get; set; }
[Navigate(typeof(RoleDeptEntity), nameof(RoleDeptEntity.RoleId), nameof(RoleDeptEntity.DeptId))]
public List<DeptEntity> Depts { get; set; }
public List<DeptEntity>? Depts { get; set; }
}
}

View File

@@ -14,12 +14,12 @@ namespace Yi.Framework.Model.Models
/// 规格sku信息
///</summary>
[SugarColumn(ColumnName = "SpecsSkuInfo", IsJson = true)]
public List<SpecsSkuInfoModel> SpecsSkuInfo { get; set; }
public List<SpecsSkuInfoModel>? SpecsSkuInfo { get; set; }
/// <summary>
/// 规格sku完整信息
///</summary>
[SugarColumn(ColumnName = "SpecsSkuAllInfo", IsJson = true)]
public List<SpecsSkuAllInfoModel> SpecsSkuAllInfo { get; set; }
public List<SpecsSkuAllInfoModel>? SpecsSkuAllInfo { get; set; }
}
public class SpecsSkuAllInfoModel

View File

@@ -11,6 +11,6 @@ namespace Yi.Framework.Model.Models
public partial class SpecsGroupEntity:IBaseModelEntity
{
[Navigate(NavigateType.OneToMany, nameof(SpecsEntity.SpecsGroupId))]
public List<SpecsEntity> Specses { get; set; }
public List<SpecsEntity>? Specses { get; set; }
}
}

View File

@@ -12,15 +12,15 @@ namespace Yi.Framework.Model.Models
/// 规格Spu完整信息
///</summary>
[SugarColumn(ColumnName = "SpecsAllInfo", IsJson = true)]
public List<SpecsSpuAllInfoModel> SpecsSpuAllInfo { get; set; }
public List<SpecsSpuAllInfoModel>? SpecsSpuAllInfo { get; set; }
/// <summary>
/// 规格Spu信息
///</summary>
[SugarColumn(ColumnName = "SpecsInfo", IsJson = true)]
public List<SpecsSpuInfoModel> SpecsSpuInfo { get; set; }
public List<SpecsSpuInfoModel>? SpecsSpuInfo { get; set; }
[Navigate(NavigateType.OneToMany, nameof(SkuEntity.SpuId))]
public List<SpuEntity> Spus { get; set; }
public List<SpuEntity>? Spus { get; set; }
}
public class SpecsSpuAllInfoModel

View File

@@ -12,13 +12,13 @@ namespace Yi.Framework.Model.Models
/// 看好啦ORM精髓导航属性
///</summary>
[Navigate(typeof(UserRoleEntity), nameof(UserRoleEntity.UserId), nameof(UserRoleEntity.RoleId))]
public List<RoleEntity> Roles { get; set; }
public List<RoleEntity>? Roles { get; set; }
[Navigate(typeof(UserPostEntity), nameof(UserPostEntity.UserId), nameof(UserPostEntity.PostId))]
public List<PostEntity> Posts { get; set; }
public List<PostEntity>? Posts { get; set; }
[Navigate( NavigateType.OneToOne,nameof(DeptId))]
public DeptEntity Dept { get; set; }
public DeptEntity? Dept { get; set; }
/// <summary>
/// 构建密码MD5盐值加密