public async Task <IActionResult> Create([Bind("Id,PhotoPath,Heading,Title,Link")] Ad ad) { if (ModelState.IsValid) { _context.Add(ad); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(ad)); }
public async Task <IActionResult> Create([Bind("Id,Logo,Phone,Email,Description,Facebook,Twitter,Instagram")] Setting setting) { if (ModelState.IsValid) { _context.Add(setting); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(setting)); }
public async Task <IActionResult> Create([Bind("Id,Name")] City city) { if (ModelState.IsValid) { _context.Add(city); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(city)); }
public async Task <IActionResult> Create([Bind("Id,Name,Price")] Shipping shipping) { if (ModelState.IsValid) { _context.Add(shipping); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(shipping)); }