public async Task <IActionResult> Create([Bind("Id,NameSize")] Size size) { if (ModelState.IsValid) { _context.Add(size); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(size)); }
public async Task <IActionResult> Create([Bind("Id, IdModle, Image, Price, Sale, Description, CreateDate, StartTime, EndTime, IdSupplier, NameProduct")] Product product) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(product)); }
public async Task <IActionResult> Create([Bind("Id,FullName,Username,Password,Email,Address,Phone,IdRole,CreateDate,Image")] Customers customers) { if (ModelState.IsValid) { _context.Add(customers); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(customers)); }
public async Task <IActionResult> Create([Bind("Id,NameColor,CodeColor")] Color color) { if (ModelState.IsValid) { _context.Add(color); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(color)); }