Exemplo n.º 1
0
        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))));
        }
Exemplo n.º 2
0
        public async Task <HttpResponseMessage> GetAll()
        {
            var response = await _servicesRuleta.Get();

            return(OkRequestResponse(OutJsonModel.BuildOk(response)));
        }