Exemplo n.º 1
0
        public void AddNewCategory(Category newCategory)
        {
            var p = new DynamicParameters();
            p.Add("categoryName", newCategory.CategoryName);

            _cn.Execute("AddNewCategory", p, commandType: CommandType.StoredProcedure);
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
 public void AddCategory(Category newCategory)
 {
     _repo.AddNewCategory(newCategory);
 }