public bool UpdateCompany(Companies entity) { try { bool isSuccess; using (var repo = new CompaniesRepository()) { isSuccess = repo.Update(entity); } return(isSuccess); } catch (Exception ex) { LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true); throw new Exception("BusinessLogic:CompaniesBusiness::UpdateCompany::Error occured.", ex); } }
public async System.Threading.Tasks.Task <OperationResult <Company> > UpdateCompany(Company company) { return(await System.Threading.Tasks.Task.Factory.StartNew <OperationResult <Company> >(() => { OperationResult <Company> result = new OperationResult <Company>(); try { if (IsInCompany(company.Id)) { result.Result = CompaniesRepository.Update(company); } } catch (Exception ex) { LoggingService.Log(ex); } return result; })); }