@@ -158,13 +158,10 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL
|
||||
|
||||
public class ProjectUser : BaseFullAuditEntity
|
||||
{
|
||||
//public string Name2 { get; set; }
|
||||
|
||||
//public string OtherName { get; set; }
|
||||
|
||||
public string Code { get; set; }
|
||||
|
||||
public string Name2 { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
//外键
|
||||
public Guid ProjectId { get; set; }
|
||||
@@ -178,20 +175,53 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL
|
||||
public Guid ProjectId { get; set; }
|
||||
|
||||
public Project Project { get; set; }
|
||||
|
||||
[Comment("NewCreateName")]
|
||||
public string NewCreateName { get; set; }
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 测试字符串长度
|
||||
|
||||
[Comment("test commment4")]
|
||||
public class TestStr: BaseFullAuditEntity
|
||||
{
|
||||
[Comment("test commment3")]
|
||||
public string DefualtLength { get; set; }
|
||||
|
||||
[Comment("test commment1")]
|
||||
[MaxLength]
|
||||
public string MaxLength { get; set; }
|
||||
|
||||
[Comment("test commment2")]
|
||||
[StringLength(400)]
|
||||
public string DefineLength { get; set;}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public class TestStr2
|
||||
{
|
||||
/// <summary>
|
||||
/// 备注1
|
||||
/// </summary>
|
||||
[StringLength(200)]
|
||||
public string DefualtLength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注1
|
||||
/// </summary>
|
||||
[MaxLength]
|
||||
public string MaxLength { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注3
|
||||
/// </summary>
|
||||
[StringLength(400)]
|
||||
public string DefineLength { get; set; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -220,4 +250,21 @@ namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL
|
||||
public string Name { get; set; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 测试默认值约束
|
||||
|
||||
|
||||
public class TestStrDefaultValue : BaseFullAuditEntity
|
||||
{
|
||||
//手动不给默认值
|
||||
public string Value1 { get; set; }
|
||||
|
||||
//手动给默认值
|
||||
public string Value2 { get; set; } = string.Empty;
|
||||
|
||||
//dbfirst 默认生成方式 项目开启了<Nullable>enable</Nullable>
|
||||
public string Value3 { get; set; } = null!;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user