Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Id,EArticleId,Comment,DOComment,IsLegal")] EArticleComment eArticleComment)
        {
            if (id != eArticleComment.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(eArticleComment);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EArticleCommentExists(eArticleComment.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(eArticleComment));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,EArticleId,Comment,DOComment,IsLegal")] EArticleComment eArticleComment)
        {
            if (ModelState.IsValid)
            {
                eArticleComment.Id = Guid.NewGuid();
                _context.Add(eArticleComment);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(eArticleComment));
        }