zmiana mapowania
This commit is contained in:
parent
812ee1b8eb
commit
5b13f70572
@ -8,6 +8,5 @@ namespace FirmTracker_Server.nHibernate.Expenses
|
|||||||
public virtual DateTime Date { get; set; }
|
public virtual DateTime Date { get; set; }
|
||||||
public virtual decimal Value { get; set; }
|
public virtual decimal Value { get; set; }
|
||||||
public virtual string Description { get; set; }
|
public virtual string Description { get; set; }
|
||||||
public virtual IList<Report> Reports { get; set; } = new List<Report>();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,12 +12,6 @@ namespace FirmTracker_Server.nHibernate.Expenses
|
|||||||
Map(x => x.Value);
|
Map(x => x.Value);
|
||||||
Map(x => x.Description);
|
Map(x => x.Description);
|
||||||
|
|
||||||
HasManyToMany(x => x.Reports)
|
|
||||||
.Cascade.All()
|
|
||||||
.Table("ReportExpenses")
|
|
||||||
.ParentKeyColumn("ExpenseId")
|
|
||||||
.ChildKeyColumn("ReportId");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@ namespace FirmTracker_Server.nHibernate.Transactions
|
|||||||
public virtual decimal Discount { get; set; }
|
public virtual decimal Discount { get; set; }
|
||||||
public virtual string Description { get; set; }
|
public virtual string Description { get; set; }
|
||||||
public virtual decimal TotalPrice { get; set; }//=> TransactionProducts.Sum(tp => ((tp.Quantity * tp.UnitPrice)* ((1 - (Discount / 100)))));// (1 - (Discount / 100)));
|
public virtual decimal TotalPrice { get; set; }//=> TransactionProducts.Sum(tp => ((tp.Quantity * tp.UnitPrice)* ((1 - (Discount / 100)))));// (1 - (Discount / 100)));
|
||||||
public virtual IList<Report> Reports { get; set; } = new List<Report>();
|
|
||||||
|
|
||||||
public Transaction()
|
public Transaction()
|
||||||
{
|
{
|
||||||
|
@ -16,7 +16,6 @@ namespace FirmTracker_Server.nHibernate.Transactions
|
|||||||
public virtual decimal Discount { get; set; }
|
public virtual decimal Discount { get; set; }
|
||||||
public virtual string Description { get; set; }
|
public virtual string Description { get; set; }
|
||||||
public virtual decimal TotalPrice { get; set; }//=> TransactionProducts.Sum(tp => ((tp.Quantity * tp.UnitPrice)* ((1 - (Discount / 100)))));// (1 - (Discount / 100)));
|
public virtual decimal TotalPrice { get; set; }//=> TransactionProducts.Sum(tp => ((tp.Quantity * tp.UnitPrice)* ((1 - (Discount / 100)))));// (1 - (Discount / 100)));
|
||||||
public virtual IList<Report> Reports { get; set; } = new List<Report>();
|
|
||||||
|
|
||||||
public Transaction2()
|
public Transaction2()
|
||||||
{
|
{
|
||||||
|
@ -19,11 +19,6 @@ namespace FirmTracker_Server.nHibernate.Transactions
|
|||||||
.Cascade.AllDeleteOrphan()
|
.Cascade.AllDeleteOrphan()
|
||||||
.Inverse(); // Ustawienie Inverse() wskazuje, że to `TransactionProduct` jest właścicielem relacji
|
.Inverse(); // Ustawienie Inverse() wskazuje, że to `TransactionProduct` jest właścicielem relacji
|
||||||
|
|
||||||
HasManyToMany(x => x.Reports)
|
|
||||||
.Cascade.All()
|
|
||||||
.Table("ReportTransactions")
|
|
||||||
.ParentKeyColumn("TransactionId")
|
|
||||||
.ChildKeyColumn("ReportId");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,11 +19,6 @@ namespace FirmTracker_Server.nHibernate.Transactions
|
|||||||
.Cascade.AllDeleteOrphan()
|
.Cascade.AllDeleteOrphan()
|
||||||
.Inverse(); // Ustawienie Inverse() wskazuje, że to `TransactionProduct` jest właścicielem relacji
|
.Inverse(); // Ustawienie Inverse() wskazuje, że to `TransactionProduct` jest właścicielem relacji
|
||||||
|
|
||||||
HasManyToMany(x => x.Reports)
|
|
||||||
.Cascade.All()
|
|
||||||
.Table("ReportTransactions")
|
|
||||||
.ParentKeyColumn("TransactionId")
|
|
||||||
.ChildKeyColumn("ReportId");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user