mirror of
https://github.com/dotnetcore/Util.git
synced 2026-10-19 05:31:23 +08:00
64 lines
1.9 KiB
C#
64 lines
1.9 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using Util.Domains;
|
|
|
|
namespace Util.Tests.Samples {
|
|
/// <summary>
|
|
/// 值对象测试样例
|
|
/// </summary>
|
|
public class ValueObjectSample : ValueObjectBase<ValueObjectSample> {
|
|
/// <summary>
|
|
/// 初始化值对象测试样例
|
|
/// </summary>
|
|
public ValueObjectSample() {
|
|
}
|
|
|
|
/// <summary>
|
|
/// 初始化值对象测试样例
|
|
/// </summary>
|
|
public ValueObjectSample( string city, string street )
|
|
: this( city, street, null ) {
|
|
}
|
|
|
|
/// <summary>
|
|
/// 初始化值对象测试样例
|
|
/// </summary>
|
|
public ValueObjectSample( string city, string street, AggregateRootSample sample )
|
|
: this( city, street, sample, null ) {
|
|
}
|
|
|
|
/// <summary>
|
|
/// 初始化值对象测试样例
|
|
/// </summary>
|
|
public ValueObjectSample( string city, string street, AggregateRootSample sample, ValueObjectSample child ) {
|
|
City = city;
|
|
Street = street;
|
|
AggregateRoot = sample;
|
|
Child = child;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 城市
|
|
/// </summary>
|
|
[StringLength( 100, ErrorMessage = "城市输入过长,不能超过100位" )]
|
|
public string City { get; private set; }
|
|
/// <summary>
|
|
/// 街道
|
|
/// </summary>
|
|
[StringLength( 200, ErrorMessage = "街道输入过长,不能超过200位" )]
|
|
public string Street { get; private set; }
|
|
|
|
/// <summary>
|
|
/// 聚合根测试样例
|
|
/// </summary>
|
|
[NotMapped]
|
|
public AggregateRootSample AggregateRoot { get; private set; }
|
|
|
|
/// <summary>
|
|
/// 子值对象测试样例
|
|
/// </summary>
|
|
[NotMapped]
|
|
public ValueObjectSample Child { get; private set; }
|
|
}
|
|
}
|