public bool InsertCompany(Companies entity)
 {
     try
     {
         bool isSuccess;
         using (var repo = new CompaniesRepository())
         {
             isSuccess = repo.Insert(entity);
         }
         return(isSuccess);
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("BusinessLogic:CompaniesBusiness::InsertCompany::Error occured.", ex);
     }
 }
        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();
            }
        }