public void CleanData()
 {
     using (var context = new TechnicalTestDbContext())
     {
         var repository = new CompaniesRepository(context);
         var allItems   = repository.Get().ToList();
         allItems.ForEach(repository.Delete);
         context.SaveChanges();
     }
 }
        public void GivenIHaveTheFollowingCompaniesWithDefaultInformation(Table table)
        {
            var items = table.CreateSet <CompanyDetailsSpecflowItem>();

            using (var context = new TechnicalTestDbContext())
            {
                var repository = new CompaniesRepository(context);
                var allItems   = repository.Get().ToList();
                allItems.ForEach(repository.Delete);

                items.ForEach(x =>
                {
                    repository.Insert(new Company {
                        Name = x.CompanyName
                    });
                });
                context.SaveChanges();
            }
        }
 public IEnumerable <Company> Get()
 {
     return(_repo.Get());
 }