Mochalov D.V. LabWork06_Base #10

Closed
b0n3l3sS wants to merge 14 commits from LabWork06_Base into LabWork05_Base
2 changed files with 3 additions and 2 deletions
Showing only changes of commit 42ebe7410b - Show all commits

View File

@ -43,6 +43,8 @@ namespace LawFirmDatabaseImplement.Implements
return context.Orders
.Include(x => x.Client)
.Include(x => x.Implementer)
.Include(x => x.Document)
.Include(x => x.Client)
.Where(x => x.ClientId == model.ClientId)
.Select(x => x.GetViewModel)
.ToList();
@ -80,7 +82,7 @@ namespace LawFirmDatabaseImplement.Implements
using var context = new LawFirmDatabase();
context.Orders.Add(newOrder);
context.SaveChanges();
return context.Orders.Include(x => x.Document).FirstOrDefault(x => x.Id == newOrder.Id)?.GetViewModel;
return context.Orders.Include(x => x.Document).Include(x => x.Client).FirstOrDefault(x => x.Id == newOrder.Id)?.GetViewModel;
}
public OrderViewModel? Update(OrderBindingModel model)

View File

@ -67,7 +67,6 @@ namespace LawFirmDatabaseImplement.Models
public OrderViewModel GetViewModel {
get
{
var context = new LawFirmDatabase();
return new ()
{