diff --git a/CarService/CarServiceDatabase/Models/Customer.cs b/CarService/CarServiceDatabase/Models/Customer.cs index 07f0ea7..fcbae4c 100644 --- a/CarService/CarServiceDatabase/Models/Customer.cs +++ b/CarService/CarServiceDatabase/Models/Customer.cs @@ -37,17 +37,6 @@ namespace CarServiceDatabase.Models Surname = model.Surname }; } - public static Customer Create(CustomerViewModel model) - { - return new() - { - Id = model.Id, - Login = model.Login, - Password = model.Password, - Name = model.Name, - Surname = model.Surname - }; - } public void Update(CustomerBindingModel? model) { if (model == null) diff --git a/CarService/CarServiceDatabase/Models/Item.cs b/CarService/CarServiceDatabase/Models/Item.cs index ab47d4a..4d8c058 100644 --- a/CarService/CarServiceDatabase/Models/Item.cs +++ b/CarService/CarServiceDatabase/Models/Item.cs @@ -38,17 +38,6 @@ namespace CarServiceDatabase.Models Worker = context.Workers.First(x => x.Id == model.WorkerId) }; } - public static Item Create(CarServiceDbContext context, ItemViewModel model) - { - return new() - { - Id = model.Id, - Name = model.Name, - Price = model.Price, - Count = model.Count, - Worker = context.Workers.First(x => x.Id == model.WorkerId) - }; - } public void Update(CarServiceDbContext context, ItemBindingModel? model) { if (model == null) diff --git a/CarService/CarServiceDatabase/Models/ItemForRepair.cs b/CarService/CarServiceDatabase/Models/ItemForRepair.cs index ca7f44f..2fe70d7 100644 --- a/CarService/CarServiceDatabase/Models/ItemForRepair.cs +++ b/CarService/CarServiceDatabase/Models/ItemForRepair.cs @@ -30,16 +30,6 @@ namespace CarServiceDatabase.Models RepairRequest = context.RepairRequests.First(x => x.Id == model.RepairRequestId) }; } - public static ItemForRepair Create(CarServiceDbContext context, ItemForRepairViewModel model) - { - return new() - { - Id = model.Id, - Count = model.Count, - Item = context.Items.First(x => x.Id == model.ItemId), - RepairRequest = context.RepairRequests.First(x => x.Id == model.RepairRequestId) - }; - } public void Update(CarServiceDbContext context, ItemForRepairBindingModel? model) { if (model == null) diff --git a/CarService/CarServiceDatabase/Models/RepairRequest.cs b/CarService/CarServiceDatabase/Models/RepairRequest.cs index 4f47592..a65572f 100644 --- a/CarService/CarServiceDatabase/Models/RepairRequest.cs +++ b/CarService/CarServiceDatabase/Models/RepairRequest.cs @@ -37,15 +37,6 @@ namespace CarServiceDatabase.Models VehicleId = model.VehicleId }; } - public static RepairRequest Create(RepairRequestViewModel model) - { - return new() - { - Id = model.Id, - DateCreated = model.DateCreated, - VehicleId = model.VehicleId - }; - } public void Update(RepairRequestBindingModel? model) { if (model == null) diff --git a/CarService/CarServiceDatabase/Models/Vehicle.cs b/CarService/CarServiceDatabase/Models/Vehicle.cs index a9694be..76b7c1c 100644 --- a/CarService/CarServiceDatabase/Models/Vehicle.cs +++ b/CarService/CarServiceDatabase/Models/Vehicle.cs @@ -36,17 +36,6 @@ namespace CarServiceDatabase.Models CustomerId = model.CustomerId }; } - public static Vehicle Create(VehicleViewModel model) - { - return new() - { - Id = model.Id, - Name = model.Name, - Plate = model.Plate, - VIN = model.VIN, - CustomerId = model.CustomerId - }; - } public void Update(VehicleBindingModel? model) { if (model == null) diff --git a/CarService/CarServiceDatabase/Models/Work.cs b/CarService/CarServiceDatabase/Models/Work.cs index a19958d..a32215b 100644 --- a/CarService/CarServiceDatabase/Models/Work.cs +++ b/CarService/CarServiceDatabase/Models/Work.cs @@ -38,17 +38,6 @@ namespace CarServiceDatabase.Models Worker = context.Workers.First(x => x.Id == model.WorkerId) }; } - public static Work Create(CarServiceDbContext context, WorkViewModel model) - { - return new() - { - Id = model.Id, - Name = model.Name, - Price = model.Price, - Duration = model.Duration, - Worker = context.Workers.First(x => x.Id == model.WorkerId) - }; - } public void Update(CarServiceDbContext context, WorkBindingModel? model) { if (model == null) diff --git a/CarService/CarServiceDatabase/Models/WorkInRequest.cs b/CarService/CarServiceDatabase/Models/WorkInRequest.cs index 627fd0e..6e9f82e 100644 --- a/CarService/CarServiceDatabase/Models/WorkInRequest.cs +++ b/CarService/CarServiceDatabase/Models/WorkInRequest.cs @@ -39,17 +39,6 @@ namespace CarServiceDatabase.Models WorkId = model.WorkId }; } - public static WorkInRequest Create(WorkInRequestViewModel model) - { - return new() - { - Id = model.Id, - Count = model.Count, - Cost = model.Cost, - RepairRequestId = model.RepairRequestId, - WorkId = model.WorkId - }; - } public void Update(WorkInRequestBindingModel? model) { if (model == null) diff --git a/CarService/CarServiceDatabase/Models/WorkPayment.cs b/CarService/CarServiceDatabase/Models/WorkPayment.cs index cdde6c1..e47f8d1 100644 --- a/CarService/CarServiceDatabase/Models/WorkPayment.cs +++ b/CarService/CarServiceDatabase/Models/WorkPayment.cs @@ -31,16 +31,6 @@ namespace CarServiceDatabase.Models WorkInRequestId = model.WorkInRequestId }; } - public static WorkPayment Create(WorkPaymentViewModel model) - { - return new() - { - Id = model.Id, - DatePayment = model.DatePayment, - Sum = model.Sum, - WorkInRequestId = model.WorkInRequestId - }; - } public void Update(WorkPaymentBindingModel? model) { if (model == null)