FirmTracker-Server/nHibernate/Transactions/TransactionMapping.cs

26 lines
707 B
C#
Raw Permalink Normal View History

using FluentNHibernate.Mapping;
namespace FirmTracker_Server.nHibernate.Transactions
{
public class TransactionMapping : ClassMap<Transaction>
{
public TransactionMapping()
{
Table("Transactions");
Id(x => x.Id).GeneratedBy.Identity();
Map(x => x.Date);
Map(x => x.EmployeeId);
Map(x => x.PaymentType);
Map(x => x.Discount);
Map(x => x.Description);
2024-06-12 14:03:49 +02:00
Map(x => x.TotalPrice).Precision(18).Scale(2);
HasMany(x => x.TransactionProducts)
.KeyColumn("TransactionId")
.Cascade.AllDeleteOrphan()
2024-06-16 23:02:04 +02:00
.Inverse();
}
}
}