удаление неиспользуемых методов в моделях

This commit is contained in:
Мк Игорь 2023-04-06 22:06:49 +04:00
parent f66f89c461
commit 2b6e86ce12
8 changed files with 0 additions and 84 deletions

View File

@ -37,17 +37,6 @@ namespace CarServiceDatabase.Models
Surname = model.Surname 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) public void Update(CustomerBindingModel? model)
{ {
if (model == null) if (model == null)

View File

@ -38,17 +38,6 @@ namespace CarServiceDatabase.Models
Worker = context.Workers.First(x => x.Id == model.WorkerId) 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) public void Update(CarServiceDbContext context, ItemBindingModel? model)
{ {
if (model == null) if (model == null)

View File

@ -30,16 +30,6 @@ namespace CarServiceDatabase.Models
RepairRequest = context.RepairRequests.First(x => x.Id == model.RepairRequestId) 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) public void Update(CarServiceDbContext context, ItemForRepairBindingModel? model)
{ {
if (model == null) if (model == null)

View File

@ -37,15 +37,6 @@ namespace CarServiceDatabase.Models
VehicleId = model.VehicleId 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) public void Update(RepairRequestBindingModel? model)
{ {
if (model == null) if (model == null)

View File

@ -36,17 +36,6 @@ namespace CarServiceDatabase.Models
CustomerId = model.CustomerId 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) public void Update(VehicleBindingModel? model)
{ {
if (model == null) if (model == null)

View File

@ -38,17 +38,6 @@ namespace CarServiceDatabase.Models
Worker = context.Workers.First(x => x.Id == model.WorkerId) 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) public void Update(CarServiceDbContext context, WorkBindingModel? model)
{ {
if (model == null) if (model == null)

View File

@ -39,17 +39,6 @@ namespace CarServiceDatabase.Models
WorkId = model.WorkId 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) public void Update(WorkInRequestBindingModel? model)
{ {
if (model == null) if (model == null)

View File

@ -31,16 +31,6 @@ namespace CarServiceDatabase.Models
WorkInRequestId = model.WorkInRequestId 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) public void Update(WorkPaymentBindingModel? model)
{ {
if (model == null) if (model == null)