Сдано
This commit is contained in:
parent
da1d5a588d
commit
568d3866b9
@ -12,14 +12,14 @@ namespace CarRepairShopDatabaseImplement.Implements
|
||||
public List<OrderViewModel> GetFullList()
|
||||
{
|
||||
using var context = new RepairsShopDatabase();
|
||||
return context.Orders.Include(x => x.Repair)
|
||||
return context.Orders.Include(x => x.Repair).Include(x => x.Client)
|
||||
.Select(x => x.GetViewModel)
|
||||
.ToList();
|
||||
}
|
||||
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
|
||||
{
|
||||
using var context = new RepairsShopDatabase();
|
||||
return context.Orders
|
||||
return context.Orders.Include(x => x.Client).Include(x => x.Repair)
|
||||
.Where(x => ((!model.Id.HasValue || x.Id == model.Id) &&
|
||||
(!model.DateFrom.HasValue || x.DateCreate >= model.DateFrom) &&
|
||||
(!model.DateTo.HasValue || x.DateCreate <= model.DateTo) &&
|
||||
|
@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
namespace CarRepairShopDatabaseImplement.Migrations
|
||||
{
|
||||
[DbContext(typeof(RepairsShopDatabase))]
|
||||
[Migration("20240409171711_InitialCreate")]
|
||||
[Migration("20240410112900_InitialCreate")]
|
||||
partial class InitialCreate
|
||||
{
|
||||
/// <inheritdoc />
|
Loading…
Reference in New Issue
Block a user