public async Task <HttpResponseMessage> Create([FromBody] RuletaDTO ruleta) { string errorMessages; if (!Helpers.Validators.IsValid(ruleta, out errorMessages)) { return(BadRequestResponse(OutJsonModel.BuildError(errorMessages))); } var ruletaModel = AutoMapper.AutoMapperConfiguration.Mapper.Map <Ruleta>(ruleta); return(OkRequestResponse(OutJsonModel.BuildOk(await _servicesRuleta.Save(ruletaModel)))); }
public async Task <HttpResponseMessage> GetAll() { var response = await _servicesRuleta.Get(); return(OkRequestResponse(OutJsonModel.BuildOk(response))); }