public History AddHtoHistory(History history) { history.EventTime = DateTime.Now; history.Owner = _securityContext.Owner; _context.Add(history); _context.SaveChanges(); return(history); }
public AuthorModel AddAuthor(AuthorModel model) { var newAuthor = new Author() { Name = model.Name }; _context.Authors.Add(newAuthor); _context.SaveChanges(); model.Id = newAuthor.Id; return(model); }