public async Task <ListLotteryResponse> ListLotteryAsync(bool active) { ListLotteryResponse response = new ListLotteryResponse { ListLotteries = await _lotteryRepository.ListLotteriesAsync(active) }; return(response); }
public async Task <IActionResult> ListLotteries(bool active) { ListLotteryResponse response = await _lotteryService.ListLotteryAsync(active); if (response.IsValid()) { return(Ok(response)); } return(BadRequest(response.GetErrors())); }