mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 01:05:27 +08:00 
			
		
		
		
	- 增加 Navigate 属性未设置 set 时的友好错误提示;
- 增加 延时属性重写类对 protected set 的支持;
This commit is contained in:
		
							
								
								
									
										52
									
								
								Examples/base_entity/Test01/Role.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								Examples/base_entity/Test01/Role.cs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,52 @@
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using Newtonsoft.Json;
 | 
			
		||||
using FreeSql.DataAnnotations;
 | 
			
		||||
using FreeSql;
 | 
			
		||||
 | 
			
		||||
namespace EMSServerModel.Model
 | 
			
		||||
{
 | 
			
		||||
	/// <summary>
 | 
			
		||||
	/// <20><>ɫ<EFBFBD><C9AB>
 | 
			
		||||
	/// </summary>
 | 
			
		||||
	[JsonObject(MemberSerialization.OptIn)]
 | 
			
		||||
	public partial class Role : BaseEntity<Role>{
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// <20><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		[JsonProperty, Column(IsPrimary = true, IsIdentity = true)]
 | 
			
		||||
		public long RoleId { get; set; }
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// <20><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		[JsonProperty, Column(DbType = "varchar(50)")]
 | 
			
		||||
		public string RoleName { get; set; } = string.Empty;
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// <20><>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD>
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		[JsonProperty, Column(DbType = "varchar(50)")]
 | 
			
		||||
		public string RoleDesc { get; set; } = string.Empty;
 | 
			
		||||
 | 
			
		||||
		///// <summary>
 | 
			
		||||
		///// <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
 | 
			
		||||
		///// </summary>
 | 
			
		||||
		//[JsonProperty, Column(DbType = "date")]
 | 
			
		||||
		//public DateTime CreateTime { get; set; } = DateTime.Now;
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// <20><><EFBFBD><EFBFBD>
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		[JsonProperty]
 | 
			
		||||
		public bool IsEnable { get; set; } = true;
 | 
			
		||||
 | 
			
		||||
		/// <summary>
 | 
			
		||||
		/// <20><>ɫ<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD>Զർ<D4B6><E0B5BC>
 | 
			
		||||
		/// </summary>
 | 
			
		||||
		[Navigate(ManyToMany = typeof(UserRole))]
 | 
			
		||||
		public virtual ICollection<User> Users { get; protected set; }
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user