添加导航属性
This commit is contained in:
24
Yi.Framework.Net6/Yi.Framework.Model/Models/RoleEntity.cs
Normal file
24
Yi.Framework.Net6/Yi.Framework.Model/Models/RoleEntity.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SqlSugar;
|
||||
namespace Yi.Framework.Model.Models
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarTable("Role")]
|
||||
public partial class RoleEntity:BaseModelEntity
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="RoleName" )]
|
||||
public string RoleName { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="TenantId" )]
|
||||
public long? TenantId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SqlSugar;
|
||||
namespace Yi.Framework.Model.Models
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarTable("UserRole")]
|
||||
public partial class UserRoleEntity:BaseModelEntity
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="RoleId" )]
|
||||
public long? RoleId { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="UserId" )]
|
||||
public long? UserId { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="TenantId" )]
|
||||
public long? TenantId { get; set; }
|
||||
}
|
||||
}
|
||||
15
Yi.Framework.Net6/Yi.Framework.Model/UserEntity.cs
Normal file
15
Yi.Framework.Net6/Yi.Framework.Model/UserEntity.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using SqlSugar;
|
||||
namespace Yi.Framework.Model.Models
|
||||
{
|
||||
public partial class UserEntity:BaseModelEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// 看好啦!ORM精髓,导航属性
|
||||
///</summary>
|
||||
[Navigate(typeof(UserRoleEntity), nameof(UserRoleEntity.UserId), nameof(UserRoleEntity.RoleId))]
|
||||
public List<RoleEntity> Roles { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user