ПИбд-23 Юнусов Нияз Наилевич Лабораторная работа №5 #11

Closed
Yunusov_Niyaz wants to merge 5 commits from Lab5 into Lab4
3 changed files with 3 additions and 3 deletions
Showing only changes of commit 568d3866b9 - Show all commits

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