public bool CreateModels() { bool homiesNewlyCreated = false; if (!_context.Locations.Any()) { _context.Locations.AddRange(CreateRandomLocations(5)); } if (!_context.Homies.Any()) { _context.AddRange(CreateRandomHomies(10)); homiesNewlyCreated = true; } _context.SaveChanges(); return(homiesNewlyCreated); }
public void Add(T entity) { _dbContext.Set <T>().Add(entity); _dbContext.SaveChanges(); }