public void Put(int id, CategoryInputView view) { view.id = id; var model = view.getModel(); repo.update(model); }
public HttpResponseMessage Post(CategoryInputView view) { var model = view.getModel(); model = repo.createCategoryInput(model); view = new CategoryInputView(model); var response = Request.CreateResponse<CategoryInputView>(HttpStatusCode.Created, view); string uri = Url.Route(null, new { id = view.id }); response.Headers.Location = new Uri(Request.RequestUri, uri); return response; }
public HttpResponseMessage Post(CategoryInputView view) { var model = view.getModel(); model = repo.createCategoryInput(model); view = new CategoryInputView(model); var response = Request.CreateResponse <CategoryInputView>(HttpStatusCode.Created, view); string uri = Url.Route(null, new { id = view.id }); response.Headers.Location = new Uri(Request.RequestUri, uri); return(response); }
public void Put(int id, CategoryInputView view) { view.id = id; var model = view.getModel(); repo.update(model); }