using NHibernate.Mapping.ByCode; using NHibernate.Mapping.ByCode.Conformist; using System; namespace Tanshu.Accounts.Entities { public class MachineLocation { public virtual Guid MachineLocationID { get; set; } public virtual string Machine { get; set; } public virtual string Location { get; set; } } public class MachineLocationMap : ClassMapping { public MachineLocationMap() { Table("MachineLocations"); Schema("dbo"); Lazy(true); Id(x => x.MachineLocationID, map => map.Generator(Generators.GuidComb)); Property(x => x.Machine, map => { map.Unique(true); map.NotNullable(true); }); Property(x => x.Location, map => map.NotNullable(true)); } } }