Hi all,
I want to have component element in my mapping file and I want the property being behind it to be accessible by a RIA services client (a Silverlight client in my case). The mapping looks like this:
Code:
<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>
and the Customer class is as this:
Code:
public class Customer
{
[Key]
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; }
}
The KetAttribute attribute is required for the RIA services. All works just fine but not the Address property does not. It is not accessible on the client side because code generators (in VS 2010) did not produce any property in the client-side Customer class...
The question is how do I make such mapping working with RIA services. I would really like to have an address consistent in a separate object instead of flat properties in the Customer class.
Thank you in advance.