diff --git a/CarRepairShop/CarRepairShopFileImplement/Implements/ComponentStorage.cs b/CarRepairShop/CarRepairShopFileImplement/Implements/ComponentStorage.cs index 6766c91..28ad1be 100644 --- a/CarRepairShop/CarRepairShopFileImplement/Implements/ComponentStorage.cs +++ b/CarRepairShop/CarRepairShopFileImplement/Implements/ComponentStorage.cs @@ -26,10 +26,7 @@ namespace CarRepairShopFileImplement.Implements { return new(); } - return source.Components - .Where(x => x.ComponentName.Contains(model.ComponentName)) - .Select(x => x.GetViewModel) - .ToList(); + return source.Components.Where(x => x.ComponentName.Contains(model.ComponentName)).Select(x => x.GetViewModel).ToList(); } public ComponentViewModel? GetElement(ComponentSearchModel model) { @@ -37,12 +34,7 @@ namespace CarRepairShopFileImplement.Implements { return null; } - return source.Components - .FirstOrDefault(x => - (!string.IsNullOrEmpty(model.ComponentName) && x.ComponentName == - model.ComponentName) || - (model.Id.HasValue && x.Id == model.Id)) - ?.GetViewModel; + return source.Components.FirstOrDefault(x =>(!string.IsNullOrEmpty(model.ComponentName) && x.ComponentName ==model.ComponentName) ||(model.Id.HasValue && x.Id == model.Id))?.GetViewModel; } public ComponentViewModel? Insert(ComponentBindingModel model) { diff --git a/CarRepairShop/CarRepairShopFileImplement/Implements/OrderStorage.cs b/CarRepairShop/CarRepairShopFileImplement/Implements/OrderStorage.cs index 0de62e2..5e093c7 100644 --- a/CarRepairShop/CarRepairShopFileImplement/Implements/OrderStorage.cs +++ b/CarRepairShop/CarRepairShopFileImplement/Implements/OrderStorage.cs @@ -25,10 +25,7 @@ namespace CarRepairShopFileImplement.Implements { return new(); } - return source.Orders - .Where(x => x.Id == model.Id) - .Select(x => AccessRepairStorage(x.GetViewModel)) - .ToList(); + return source.Orders.Where(x => x.Id == model.Id).Select(x => AccessRepairStorage(x.GetViewModel)).ToList(); } public OrderViewModel? GetElement(OrderSearchModel model) { @@ -36,8 +33,7 @@ namespace CarRepairShopFileImplement.Implements { return null; } - return AccessRepairStorage(source.Orders - .FirstOrDefault(x => (model.Id.HasValue && x.Id == model.Id))?.GetViewModel); + return AccessRepairStorage(source.Orders.FirstOrDefault(x => (model.Id.HasValue && x.Id == model.Id))?.GetViewModel); } public OrderViewModel? Insert(OrderBindingModel model) { diff --git a/CarRepairShop/CarRepairShopFileImplement/Implements/RepairStorage.cs b/CarRepairShop/CarRepairShopFileImplement/Implements/RepairStorage.cs index 3495e64..9f143a4 100644 --- a/CarRepairShop/CarRepairShopFileImplement/Implements/RepairStorage.cs +++ b/CarRepairShop/CarRepairShopFileImplement/Implements/RepairStorage.cs @@ -26,10 +26,7 @@ namespace CarRepairShopFileImplement.Implements { return new(); } - return source.Repairs - .Where(x => x.RepairName.Contains(model.RepairName)) - .Select(x => x.GetViewModel) - .ToList(); + return source.Repairs.Where(x => x.RepairName.Contains(model.RepairName)).Select(x => x.GetViewModel).ToList(); } public RepairViewModel? GetElement(RepairSearchModel model) @@ -38,12 +35,7 @@ namespace CarRepairShopFileImplement.Implements { return null; } - return source.Repairs - .FirstOrDefault(x => - (!string.IsNullOrEmpty(model.RepairName) && x.RepairName == - model.RepairName) || - (model.Id.HasValue && x.Id == model.Id)) - ?.GetViewModel; + return source.Repairs.FirstOrDefault(x =>(!string.IsNullOrEmpty(model.RepairName) && x.RepairName ==model.RepairName) ||(model.Id.HasValue && x.Id == model.Id))?.GetViewModel; } public RepairViewModel? Insert(RepairBindingModel model)