EF7 Notimplemented [WA]
This commit is contained in:
parent
73bfbf609b
commit
9f8acc1f5a
1 changed files with 27 additions and 2 deletions
|
|
@ -54,8 +54,33 @@ namespace Yavsc.Controllers
|
||||||
ViewData["HasHaircutCommand"] = DbContext.HairCutQueries.Any
|
ViewData["HasHaircutCommand"] = DbContext.HairCutQueries.Any
|
||||||
(q=>q.ClientId == uid && q.Status < QueryStatus.Failed);
|
(q=>q.ClientId == uid && q.Status < QueryStatus.Failed);
|
||||||
|
|
||||||
return View(DbContext.Activities.Where(a=>a.ParentCode==id && !a.Hidden).Include(a=>a.Forms).Include(a=>a.Children)
|
if (id==null) {
|
||||||
.OrderByDescending(a=>a.Rate));
|
// Workaround
|
||||||
|
// NotImplementedException: Remotion.Linq.Clauses.ResultOperators.ConcatResultOperator
|
||||||
|
//
|
||||||
|
// Use Concat()| whatever to do left outer join on ToArray() or ToList(), not on IQueryable
|
||||||
|
|
||||||
|
var legacy = DbContext.Activities
|
||||||
|
.Include(a=>a.Forms).Include(a=>a.Children)
|
||||||
|
.Where(a=> !a.Hidden)
|
||||||
|
.Where(a=> a.ParentCode==null).ToArray();
|
||||||
|
// OMG
|
||||||
|
var hiddenchildren = DbContext.Activities
|
||||||
|
.Include(a=>a.Forms).Include(a=>a.Children)
|
||||||
|
.Where(a=> a.Parent.Hidden && !a.Hidden).ToArray();
|
||||||
|
|
||||||
|
return View(legacy.Concat(hiddenchildren).OrderByDescending(a=>a.Rate));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return View(DbContext.Activities
|
||||||
|
.Include(a=>a.Forms).Include(a=>a.Children)
|
||||||
|
.Where(a=>!a.Hidden)
|
||||||
|
.Where(a=> a.ParentCode==id).OrderByDescending(a=>a.Rate));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public IActionResult About()
|
public IActionResult About()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue