public ActionResult <RequestStatus> PostRequestStatus(RequestStatus requestStatus) { _requestStatusRepository.Add(requestStatus); _requestStatusRepository.Save(); return(CreatedAtAction("GetRequestStatus", new { id = requestStatus.Id }, requestStatus)); }
public IActionResult CreateRequest([FromBody] Request request) { if (request == null) { return(BadRequest()); } _repository.Add(request); RequestStatus status = new RequestStatus() { Id = request.Id, Status = RequestStatusTypes.InTransit, SourceId = "SERVER_ID", Timestamp = DateTime.UtcNow, }; _statusRepository.Add(status); return(CreatedAtRoute("GetRequest", new { id = request.Key }, request)); }