Exemplo n.º 1
0
        public void UpateServiceGymViewModel(int?id, ServiceGymViewModel serviceGymViewModel)
        {
            try
            {
                if (id == null)
                {
                    throw new Exception("El parametro id es un nulo");
                }
                var serviceGym = _serviceGymRepository.GetServiceGymById(id);
                if (serviceGym == null)
                {
                    _logger.LogWarning("Error al traer el service Gym");
                    throw new Exception("Error en la obtencion del service Gym");
                }

                _converterServiceGymViewModelToServiceGym.Map(serviceGymViewModel, serviceGym);
                _serviceGymRepository.UpdateServiceGym(serviceGym);
                //_logger.LogInformation("ServiceGym Actualizado");
            }
            catch (Exception e)
            {
                //_logger.LogWarning("exception al actualizar el cliente especifico");
                throw new Exception("Error al actualizar el cliente. message: " + e.Message);
            }
        }