저는 Sharp Architecture를 사용하고 있으며 Entity에서 Value Objects를 사용하는 경우가 많습니다.Fluent-nhibernate를 사용하면 Entity 내부에서 Value Object를 자동으로 매핑 할 수 있습니까?
물론public class Person : Entity
{
protected Person(){}
public Person(string personName)
{
this.PersonName = personName;
}
public virtual string PersonName { get; protected set;}
public virtual StreetAddress MailingAddress { get; set; }
}
public class StreetAddress : ValueObject
{
protected StreetAddress(){}
public StreetAddress(string address1, string address2, string city, string state, string postalCode, string country)
{
this.Address1 = address1;
this.Address2 = address2;
this.City = city;
this.State = state;
this.PostalCode = postalCode;
this.Country = country;
}
public virtual string Address1 { get; protected set; }
public virtual string Address2 { get; protected set; }
public virtual string City { get; protected set; }
public virtual string State { get; protected set; }
public virtual string PostalCode { get; protected set; }
public virtual string Country { get; protected set; }
}
이 발생 :
An association from the table Person refers to an unmapped class: Project.Domain.StreetAddress상기 AutoPersistenceModelGenerator 전용 타입 클래스> < IEntityWithTypedId을 포함하기 때문에 여기서 명백한 간단한 예이다. 샤프 아키텍처 (Sharp Architecture)가이 공통 조건이 어떻게 구현 될 것으로 기대되는지는 분명하지 않습니다. 이것은 bazillion overrides로 처리해야합니까?