This commit is contained in:
2020-05-07 19:53:23 +00:00
parent ef7d2d2ba2
commit d131d16d17
2 changed files with 12 additions and 2 deletions

View File

@@ -106,12 +106,20 @@ namespace AyaNova.Biz
.ThenInclude(author => author.Photo)
.ToList();
}
WARNING: Since version 3.0.0, each Include will cause an additional JOIN to be added to SQL queries produced by relational providers, whereas previous versions generated additional SQL queries. This can significantly change the performance of your queries, for better or worse. In particular, LINQ queries with an exceedingly high number of Include operators may need to be broken down into multiple separate LINQ queries in order to avoid the cartesian explosion problem.
WARNING: Since version 3.0.0, each Include will cause an additional JOIN to be added to SQL queries produced by relational providers, whereas previous versions generated additional SQL queries.
This can significantly change the performance of your queries, for better or worse.
In particular, LINQ queries with an exceedingly high number of Include operators may need to be broken down into multiple separate LINQ queries in order to avoid the cartesian explosion problem.
*/
//This is simple so nothing more here, but often will be copying to a different output object or some other ops
//var ret = await ct.WorkOrder.SingleOrDefaultAsync(m => m.Id == fetchId);
var ret = await ct.WorkOrder.Include(w => w.WorkorderItems).SingleOrDefaultAsync(m => m.Id == fetchId);
var ret =
await ct.WorkOrder
.Include(w => w.WorkorderItems)
.ThenInclude(wi=>wi.WorkorderItemLabors)
.Include(w => w.WorkorderItems)
.ThenInclude(wi=>wi.worko)
.SingleOrDefaultAsync(m => m.Id == fetchId);
if (logTheGetEvent && ret != null)
{

View File

@@ -30,11 +30,13 @@ namespace AyaNova.Models
//dependents
public List<WorkOrderItemLabor> WorkorderItemLabors { get; set; }
public List<WorkOrderItemPart> WorkorderItemParts { get; set; }
public WorkOrderItem()
{
Tags = new List<string>();
WorkorderItemLabors = new List<WorkOrderItemLabor>();
WorkorderItemParts = new List<WorkOrderItemPart>();
}
//Not persisted business properties