Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        public async Task AddDocument(Document document)
        {
            await documentManagerContext.Documents.AddAsync(document);

            await documentManagerContext.SaveChangesAsync();
        }