using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Util.Domain.Entities;
namespace Util.Domain.Tests.Samples;
///
/// 值对象测试样例
///
public class ValueObjectSample : ValueObjectBase {
///
/// 初始化值对象测试样例
///
public ValueObjectSample() {
}
///
/// 初始化值对象测试样例
///
public ValueObjectSample( string city, string street )
: this( city, street, null ) {
}
///
/// 初始化值对象测试样例
///
public ValueObjectSample( string city, string street, AggregateRootSample sample )
: this( city, street, sample, null ) {
}
///
/// 初始化值对象测试样例
///
public ValueObjectSample( string city, string street, AggregateRootSample sample, ValueObjectSample child ) {
City = city;
Street = street;
AggregateRoot = sample;
Child = child;
}
///
/// 城市
///
[StringLength( 100, ErrorMessage = "城市输入过长,不能超过100位" )]
public string City { get; private set; }
///
/// 街道
///
[StringLength( 200, ErrorMessage = "街道输入过长,不能超过200位" )]
public string Street { get; private set; }
///
/// 聚合根测试样例
///
[NotMapped]
public AggregateRootSample AggregateRoot { get; private set; }
///
/// 子值对象测试样例
///
[NotMapped]
public ValueObjectSample Child { get; private set; }
}