public void AddNewCategory(Category newCategory) { var p = new DynamicParameters(); p.Add("categoryName", newCategory.CategoryName); _cn.Execute("AddNewCategory", p, commandType: CommandType.StoredProcedure); }
public HttpResponseMessage Post(Category newCategory) { var ops = new BlogPostOperations(); ops.AddCategory(newCategory); var response = Request.CreateResponse(HttpStatusCode.Created, newCategory); string uri = Url.Link("DefaultApi", new {id = newCategory.CategoryID}); response.Headers.Location = new Uri(uri); return response; }
public void AddCategory(Category newCategory) { _repo.AddNewCategory(newCategory); }