나는 Address 클래스의 객체이고 속성이 거의없는 주소로 등록 정보 인 Customer라는 엔티티 클래스를 보유하고 있습니다. 다음과 같이 보입니다 :RIA 서비스 및 사용자 정의 유형의 유형
public partial class Customer
{
public virtual int ID { get; set; }
public virtual string Symbol { get; set; }
public virtual string Name { get; set; }
public virtual string FirstName { get; set; }
public virtual string LastName { get; set; }
public virtual string NIP { get; set; }
public virtual Address Address { get; set; }
}
public partial class Address
{
public virtual int ID { get; set; }
public virtual string Descriptive { get; set; }
public virtual string Street { get; set; }
public virtual string City { get; set; }
public virtual string PostCode { get; set; }
public virtual string Country { get; set; }
}
데이터베이스 또는 엔티티의 sanse에는 아무 관계도 없습니다. Address는 Customer 클래스에 포함 된 객체이며 NHibernate 프레임 워크에 의해 생성됩니다. 실제로 < 구성 요소 /> 매핑 요소는 사용되는 :
<class name="Customer" table="`CRM_CUSTOMER`">
<id name="ID">
<generator class="native" />
</id>
<property name="Symbol" unique="true" />
<property name="Name" />
<property name="FirstName" />
<property name="LastName" />
<property name="NIP" />
<component name="Address" class="Address">
<property name="Descriptive" />
<property name="Street" />
<property name="City" />
<property name="PostCode" />
<property name="Country" />
</component>
</class>
그러나, 클라이언트가 전혀 Address 클래스/속성을 참조하지 않는 코드를 생성합니다. 아무것도 도움이되지 않습니다. 기사가 많고 아무것도 읽지 않았습니다. 그래서 누군가가 도울 수 있다면, 정말 고맙겠습니다.
VS 2010 Proffesional을 사용하고 있습니다.
TIA
롤랜드