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

42 lines
1.1 KiB
C#
Raw Normal View History

using System;
using System.Runtime.Serialization;
using Tanshu.Accounts.Contracts;
using NHibernate.Mapping.ByCode.Conformist;
using NHibernate.Mapping.ByCode;
namespace Tanshu.Accounts.Entities
{
public class InventoryModifier
{
public virtual Guid InventoryModifierID { get; set; }
public virtual Inventory Inventory { get; set; }
public virtual Modifier Modifier { get; set; }
}
public class InventoryModifierMap : ClassMapping<InventoryModifier>
{
public InventoryModifierMap()
{
Table("InventoryModifiers");
Schema("dbo");
Lazy(true);
Id(x => x.InventoryModifierID, map => map.Generator(Generators.GuidComb));
ManyToOne(x => x.Inventory, map =>
{
map.Column("InventoryID");
map.NotNullable(true);
map.Cascade(Cascade.None);
});
ManyToOne(x => x.Modifier, map =>
{
map.Column("ModifierID");
map.NotNullable(true);
map.Cascade(Cascade.None);
});
}
}
}