using Castle.ActiveRecord; namespace ECOEarth.Web.Domain { [ActiveRecord] public class Customer : ActiveRecordBase { public string name; [Property] public virtual string Name { get { return name; } set { name = value; } } public string email; public string telephone; private int customerId; private Address deliveryAddress; private Address billngAddress; private Order order; private int orderId; [PrimaryKey(PrimaryKeyType.Native)] public int CustomerId { get { return customerId; } set { customerId = value; } } [BelongsTo("DeliveryAddressId", Cascade=CascadeEnum.SaveUpdate)] public virtual Address DeliveryAddress { get { return deliveryAddress; } set { deliveryAddress = value; } } [BelongsTo("BillingAddressId", Cascade = CascadeEnum.SaveUpdate)] public virtual Address BillingAddress { get { return billngAddress; } set { billngAddress = value; } } [Property] public virtual string Email { get { return email; } set { email = value; } } [Property] public virtual string Telephone { get { return telephone; } set { telephone = value; } } } }