//in case create new task // or update task by manager to assign it to group public async Task <IHttpActionResult> Post(request req) { if (ModelState.IsValid) { try { request modireq = await Repo.GetEntity(req.Id); if (modireq != null)//for update { Repo.Update(req); } else { Repo.Add(new request() { requestTitle = req.requestTitle, requestBody = req.requestBody }); //for new UOW.Save(); } return(Ok(new request())); } catch (Exception e) { return(BadRequest()); } } else { return(BadRequest()); } }
public async Task <IHttpActionResult> Get(int id) { user user = await Repo.GetEntity(id); return(Ok(user)); }