public List <DogOwner> GenerateOwners(int number = 1, bool save = false) { var owners = new List <DogOwner>(); while (owners.Count < number) { owners.Add(GenerateOwner()); } if (save) { _dbContext.AddRange(owners.Select(o => (DogOwner)o)); _dbContext.SaveChanges(); } return(owners); }