Сдано

This commit is contained in:
Yunusov_Niyaz 2024-04-10 16:17:56 +04:00
parent da1d5a588d
commit 568d3866b9
3 changed files with 3 additions and 3 deletions

View File

@ -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) &&

View File

@ -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 />