//[ValidateAntiForgeryToken]
 public JsonResult CreateSale([FromBody] ProductSold productSold)
 {
     if (ModelState.IsValid)
     {
         _context.Add(productSold);
         _context.SaveChanges();
     }
     return(Json(productSold));
 }
        //[ValidateAntiForgeryToken]
        public JsonResult CreateStore([FromBody] Store store)

        {
            if (ModelState.IsValid)
            {
                _context.Add(store);
                _context.SaveChanges();
            }
            return(Json(store));
        }
Beispiel #3
0
        // [ValidateAntiForgeryToken]
        public JsonResult CreateCustomer([FromBody] Customer customer)

        {
            if (ModelState.IsValid)
            {
                _context.Add(customer);
                _context.SaveChanges();
            }
            return(Json(customer));
        }