22 lines
710 B
C#
22 lines
710 B
C#
using FluentNHibernate.Mapping;
|
|
using Results.Entities;
|
|
|
|
namespace Results.Mappings
|
|
{
|
|
public class PurchaseOrderMap : ClassMap<PurchaseOrder>
|
|
{
|
|
public PurchaseOrderMap()
|
|
{
|
|
Table("purchase_orderdata");
|
|
Id(x => x.Id);
|
|
Map(x => x.Name).Column("PurchaseOrder");
|
|
|
|
HasMany(x => x.PurchaseBoxList)
|
|
.Cascade.All()
|
|
.KeyColumn("PurchaseOrderId") // This should match the foreign key in `purchase_boxdata`
|
|
.Inverse() // This is important if `PurchaseBox` holds the foreign key
|
|
.LazyLoad(); // Optional: Depends on your performance needs
|
|
|
|
}
|
|
}
|
|
} |