public async Task SaveOrder(OrderColorModel orderColor)
        {
            var idOrder = await SaveOrderServices(orderColor.sumOrder.Value);

            ServiceColorBll serviceColor = new ServiceColorBll();

            foreach (var item in orderColor.priceColor)
            {
                serviceColor.clientsOfCarWashId     = orderColor.clientInfo.Id;
                serviceColor.orderServicesCarWashId = idOrder;
                serviceColor.priceColorId           = item.idColor;
                serviceColor.price = item.Price;

                await _colorServices.Insert(serviceColor);
            }
        }
Пример #2
0
 private ServiceColor EntityTransformation(ServiceColorBll entity) =>
 Mapper.Map <ServiceColorBll, ServiceColor>(entity);
Пример #3
0
 public async Task Update(ServiceColorBll elementToUpdate)
 {
     _unitOfWork.ServicesColorUnitOfWork.Update(EntityTransformation(elementToUpdate));
     await _unitOfWork.Save();
 }
Пример #4
0
 public async Task Insert(ServiceColorBll element)
 {
     _unitOfWork.ServicesColorUnitOfWork.Insert(EntityTransformation(element));
     await _unitOfWork.Save();
 }