Ejemplo n.º 1
0
        public ServiceStep GetServiceStep(int id)
        {
            ServiceStep steppers = null;

            // int id = (int)id;
            return(steppers = _serviceStepperRepo.GetRecord(id));
        }
Ejemplo n.º 2
0
        public async Task <ServiceStep> SaveServiceStep([FromBody] ServiceStep PostedServiceStep)
        {
            if (!ModelState.IsValid)
            {
                throw new ApiException("Model binding failed.", 500);
            }
            //if (!_serviceStepperRepo.Validate(PostedServiceStep))
            //    throw new ApiException(_serviceStepperRepo.ErrorMessage, 500, _serviceStepperRepo.ValidationErrors);
            if (!await _serviceStepperRepo.SaveAsync(PostedServiceStep))
            {
                throw new ApiException(_serviceStepperRepo.ErrorMessage);
            }

            return(PostedServiceStep);
        }