Пример #1
0
 public void Add <T> (T entity) where T : class
 {
     _context.Add(entity);
 }
Пример #2
0
 public void Add<T>(T entity) where T : class
 {
     _logger.LogInformation($"Adding an object of type {entity.GetType()} to the context.");
     _context.Add(entity);
 }