Exemplo n.º 1
0
 public History AddHtoHistory(History history)
 {
     history.EventTime = DateTime.Now;
     history.Owner     = _securityContext.Owner;
     _context.Add(history);
     _context.SaveChanges();
     return(history);
 }
Exemplo n.º 2
0
        public AuthorModel AddAuthor(AuthorModel model)
        {
            var newAuthor = new Author()
            {
                Name = model.Name
            };

            _context.Authors.Add(newAuthor);
            _context.SaveChanges();
            model.Id = newAuthor.Id;
            return(model);
        }