/// <summary> /// Import company /// </summary> /// <returns></returns> private int ImportCompanies() { var number = 0; for (var i = 0; i < 20; i++) { var company = new Company(); company.Key = Guid.NewGuid(); company.Name = Faker.Company.Name(); company.Bs = Faker.Company.BS(); company.CatchPhrase = Faker.Company.CatchPhrase(); company.Street = Address.StreetAddress(); company.Zipcode = Address.UkPostCode(); company.City = Address.City(); company.Phone = Phone.Number(); company.Employees = GetEmployees(); _client.Index(company); number++; } return(number); }
/// <summary> /// Import users /// </summary> /// <returns></returns> private List <Employee> GetEmployees() { var list = new List <Employee>(); for (var i = 0; i < 20; i++) { var user = new Employee(); user.Key = Guid.NewGuid(); user.Name = Name.FullName(); user.Username = Internet.UserName(); user.EmailAddress = Internet.Email(); user.Phone = Phone.Number(); user.Street = Address.StreetAddress(); user.Zipcode = Address.UkPostCode(); user.City = Address.City(); user.Country = Address.Country(); user.Age = RandomNumber.Next(18, 65); list.Add(user); } return(list); }