public async Task <IActionResult> Create([Bind("Id,Description,Ip,ReloadDate")] Server server) { if (ModelState.IsValid) { _context.Add(server); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(server)); }
public async Task <IActionResult> Create([Bind("Id,ServerId,Text,ProcessingDate,Type,Priority,LoadLevel")] Message message) { if (ModelState.IsValid) { _context.Add(message); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewBag.Types = new SelectList(func.TypeList.AsEnumerable()); ViewData["ServerId"] = new SelectList(_context.Set <Server>(), "Id", "Id", message.ServerId); return(View(message)); }