public IHttpActionResult  DeleteSubcategory(int id)
        {
            if (id <= 0)
            {
                return(BadRequest("Not a valid student id"));
            }

            using (var ctx = new AkankshaEntities())
            {
                var student = ctx.Subcategories
                              .Where(s => s.SubcategoryId == id)
                              .FirstOrDefault();

                ctx.Entry(student).State = System.Data.Entity.EntityState.Deleted;
                ctx.SaveChanges();
            }

            return(Ok());
        }
Exemplo n.º 2
0
 public ProductController()
 {
     db = new Akanksha.AkankshaEntities();
 }
Exemplo n.º 3
0
 public CategoryController()
 {
     db = new AkankshaEntities();
 }
Exemplo n.º 4
0
 public CartController()
 {
     db = new AkankshaEntities();
 }
Exemplo n.º 5
0
 public NormalUserController()
 {
     db = new AkankshaEntities();
 }
Exemplo n.º 6
0
 public HomeController()
 {
     db = new AkankshaEntities();
 }
Exemplo n.º 7
0
 public AdminController()
 {
     db = new AkankshaEntities();
 }