diff --git a/FlowerShopClientApp/APIClient.cs b/FlowerShopClientApp/APIClient.cs index 7ae5c99..ab6bba1 100644 --- a/FlowerShopClientApp/APIClient.cs +++ b/FlowerShopClientApp/APIClient.cs @@ -13,8 +13,7 @@ namespace FlowerShopClientApp { _client.BaseAddress = new Uri(configuration["IPAddress"]); _client.DefaultRequestHeaders.Accept.Clear(); - _client.DefaultRequestHeaders.Accept.Add(new - MediaTypeWithQualityHeaderValue("application/json")); + _client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); } public static T? GetRequest(string requestUrl) { diff --git a/FlowerShopDatabaseImplement/OrderStorage.cs b/FlowerShopDatabaseImplement/OrderStorage.cs index e51926c..4d20bc9 100644 --- a/FlowerShopDatabaseImplement/OrderStorage.cs +++ b/FlowerShopDatabaseImplement/OrderStorage.cs @@ -18,7 +18,7 @@ namespace FlowerShopDatabaseImplement.Implements public List GetFullList() { using var context = new FlowerShopDataBase(); - return context.Orders.Include(x => x.Flower) + return context.Orders.Include(x => x.Flower).Include(x => x.Client) .Select(x => x.GetViewModel) .ToList(); } @@ -30,7 +30,8 @@ namespace FlowerShopDatabaseImplement.Implements return context.Orders.Include(x => x.Flower) .Where(x => ((!model.Id.HasValue || x.Id == model.Id) && (!model.DateFrom.HasValue || x.DateCreate >= model.DateFrom) && - (!model.DateTo.HasValue || x.DateCreate <= model.DateTo))) + (!model.DateTo.HasValue || x.DateCreate <= model.DateTo) && + (!model.ClientId.HasValue || x.ClientId == model.ClientId))) .Select(x => x.GetViewModel) .ToList(); }