public void Post([FromBody] Form form)
 {
     using (ECommDBContext _context = new ECommDBContext())
     {
         form.Id = Guid.NewGuid();
         _context.Forms.Add(form);
         _context.SaveChanges();
     }
 }
Ejemplo n.º 2
0
        public IActionResult Create([Bind("Id,Name")] Category category)
        {
            if (ModelState.IsValid)
            {
                _context.Categories.Add(category);
                _context.SaveChanges();
            }

            return(View(category));
        }