merge
This commit is contained in:
commit
42ebe7410b
@ -43,6 +43,8 @@ namespace LawFirmDatabaseImplement.Implements
|
|||||||
return context.Orders
|
return context.Orders
|
||||||
.Include(x => x.Client)
|
.Include(x => x.Client)
|
||||||
.Include(x => x.Implementer)
|
.Include(x => x.Implementer)
|
||||||
|
.Include(x => x.Document)
|
||||||
|
.Include(x => x.Client)
|
||||||
.Where(x => x.ClientId == model.ClientId)
|
.Where(x => x.ClientId == model.ClientId)
|
||||||
.Select(x => x.GetViewModel)
|
.Select(x => x.GetViewModel)
|
||||||
.ToList();
|
.ToList();
|
||||||
@ -80,7 +82,7 @@ namespace LawFirmDatabaseImplement.Implements
|
|||||||
using var context = new LawFirmDatabase();
|
using var context = new LawFirmDatabase();
|
||||||
context.Orders.Add(newOrder);
|
context.Orders.Add(newOrder);
|
||||||
context.SaveChanges();
|
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)
|
public OrderViewModel? Update(OrderBindingModel model)
|
||||||
|
@ -67,7 +67,6 @@ namespace LawFirmDatabaseImplement.Models
|
|||||||
public OrderViewModel GetViewModel {
|
public OrderViewModel GetViewModel {
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
var context = new LawFirmDatabase();
|
|
||||||
return new ()
|
return new ()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user