public ActionResult <ItemResponse <Advertiser> > GetAll() { int code = 200; BaseResponse response = null; try { List <Advertiser> list = _service.GetAll(); if (list == null) { code = 404; response = new ErrorResponse("App Resourse not found."); } else { response = new ItemsResponse <Advertiser> { Items = list }; } } catch (Exception ex) { code = 500; response = new ErrorResponse(ex.Message); { base.Logger.LogError(ex.ToString()); } } return(StatusCode(code, response)); }
public IActionResult GetAllAdvertiser() { var model = _advertiserService.GetAll(); return(new OkObjectResult(model)); }