narsil/Tanshu.Accounts.Contracts/Data Contracts/WaiterBO.cs

29 lines
927 B
C#
Raw Normal View History

2010-03-02 17:56:21 +00:00
using System;
using System.Runtime.Serialization;
using Tanshu.Accounts.Contracts;
using NHibernate.Mapping.ByCode.Conformist;
using NHibernate.Mapping.ByCode;
using System.Collections.Generic;
2010-03-02 17:56:21 +00:00
namespace Tanshu.Accounts.Entities
2010-03-02 17:56:21 +00:00
{
public class Waiter
2010-03-02 17:56:21 +00:00
{
public virtual Guid WaiterID { get; set; }
public virtual string Name { get; set; }
public virtual IList<Voucher> Vouchers { get; set; }
}
public class WaiterMap : ClassMapping<Waiter>
{
public WaiterMap()
{
Table("Waiters");
Schema("dbo");
Lazy(true);
Id(x => x.WaiterID, map => map.Generator(Generators.GuidComb));
Property(x => x.Name, map => { map.NotNullable(true); map.Unique(true); });
Bag(x => x.Vouchers, colmap => { colmap.Key(x => x.Column("WaiterID")); colmap.Inverse(true); }, map => { map.OneToMany(); });
}
2010-03-02 17:56:21 +00:00
}
}