public async Task <ActionResult <IEnumerable <RouletteDTO> > > GetRoulettes() { ResponseList <Roulette> responseRoulettes = await rouletteServices.GetAllRoulettes(); if (responseRoulettes.Code.Equals(Enumerators.State.Error.GetDescription())) { return(BadRequest(responseRoulettes)); } return(MappersFactory.RouletteDTO().ListMap(responseRoulettes.List)); }
public async Task <ActionResult <RouletteDTO> > GetRoulette(long id) { Response response = await rouletteServices.ValidateRoulette(id); if (response.Code.Equals(Enumerators.State.Error.GetDescription())) { return(BadRequest(response)); } ResponseEntity <Roulette> responseRoulette = await rouletteServices.GetRouletteById(id); if (responseRoulette.Code.Equals(Enumerators.State.Error.GetDescription())) { return(BadRequest(responseRoulette)); } return(MappersFactory.RouletteDTO().Map(responseRoulette.Entity)); }