public async Task <IHttpActionResult> GetComplaints(MobileRequest mobileRequest) { Responce <List <ComplaintsDTO> > responce = new Responce <List <ComplaintsDTO> >(); var HttpRequest = HttpContext.Current.Request; try { string UserName = User.Identity.GetUserId(); //mobileRequest.Username = UserName; if (!string.IsNullOrEmpty(UserName)) { mobileRequest.Username = UserName; } responce = await _complaintService.GetComplaint(mobileRequest); return(Ok(responce)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public ActionResult <ComplaintModel> Get(int id) { _logger.LogInformation("Request for Complaint id {0}", id); var complaintItem = _db.GetComplaint(id); if (complaintItem == null) { _logger.LogError("Complaint Not Found for id {0}", id); return(NotFound()); } _logger.LogInformation("Complaint id {0} request completed", id); return(complaintItem); }