Fixes
This commit is contained in:
parent
c27f6c9662
commit
235873dc7a
@ -1,4 +1,5 @@
|
||||
using ShipyardContracts.BindingModels;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using ShipyardContracts.BindingModels;
|
||||
using ShipyardContracts.SearchModels;
|
||||
using ShipyardContracts.StoragesContracts;
|
||||
using ShipyardContracts.ViewModels;
|
||||
@ -65,17 +66,8 @@ namespace ShipyardDataBaseImplement.Implements
|
||||
{
|
||||
using var context = new ShipyardDataBase();
|
||||
return context.Orders
|
||||
.Select(x => new OrderViewModel
|
||||
{
|
||||
Id = x.Id,
|
||||
ShipId = x.ShipId,
|
||||
Count = x.Count,
|
||||
Sum = x.Sum,
|
||||
Status = x.Status,
|
||||
DateCreate = x.DateCreate,
|
||||
DateImplement = x.DateImplement,
|
||||
ShipName = x.Ship.ShipName
|
||||
})
|
||||
.Include(x => x.Ship)
|
||||
.Select(x => x.GetViewModel)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ namespace ShipyardDataBaseImplement.Models
|
||||
public DateTime? DateImplement { get; set; }
|
||||
|
||||
public int Id { get; set; }
|
||||
public Ship? Ship { get; set; }
|
||||
public virtual Ship Ship { get; set; }
|
||||
public static Order? Create(OrderBindingModel? model)
|
||||
{
|
||||
if (model == null)
|
||||
@ -64,7 +64,8 @@ namespace ShipyardDataBaseImplement.Models
|
||||
Sum = Sum,
|
||||
Status = Status,
|
||||
DateCreate = DateCreate,
|
||||
DateImplement = DateImplement
|
||||
DateImplement = DateImplement,
|
||||
ShipName=Ship.ShipName
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user