I have a Customer which has Addresses:
public class Customer
{
public int Id { get; set; }
public string Name { get; set; }
public ICollection<Address> Addresses { get; private set; }
}
public class Address
{
public string City { get; set; }
public string Country { get; set; }
public string StreetName { get; set; }
public string ZipCode { get; set; }
}
I want to map this to NHibernate 3.2. which has fluent interface, but not exactly the same as well-known Fluent NHibernate.
I know that I have to use Bag, and maybe Element? Or component?
So it should be something like this:
Bag(
property => property.Addresses,
collectionMapping => {}, // not important now
mapping => // and what should I use here, and how?
);
Thanks.
more info: http://moh-abed.com/2011/08/14/nhibernate-3-2-mapping-entities-and-value-objects-by-code/