public async Task <IActionResult> Create([Bind("Id,Name")] DocumentType documentType) { if (ModelState.IsValid) { _context.Add(documentType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(documentType)); }
public async Task AddDocument(Document document) { await documentManagerContext.Documents.AddAsync(document); await documentManagerContext.SaveChangesAsync(); }