public ValidatorDC GetValidator(string userName, string currentUserName, string appID, string overrideID, string code, IRepository <Validator> dataRepository, IUnitOfWork uow) { try { using (uow) { Guid codeGuid = Guid.Parse(code); Validator dataEntity = dataRepository.Single(x => x.Code == codeGuid); ValidatorDC destination = Mapper.Map <Validator, ValidatorDC>(dataEntity); return(destination); } } catch (Exception e) { //Prevent exception from propogating across the service interface ExceptionManager.ShieldException(e); return(null); } }
public void CreateValidator(string userName, string currentUserName, string appID, string overrideID, ValidatorDC dc, IRepository <Validator> dataRepository, IUnitOfWork uow) { try { using (uow) { Validator destination = Mapper.Map <ValidatorDC, Validator>(dc); dataRepository.Add(destination); uow.Commit(); } } catch (Exception e) { //Prevent exception from propogating across the service interface ExceptionManager.ShieldException(e); } }
public void CreateValidator(string userName, string currentUserName, string appID, string overrideID, ValidatorDC dc) { IUnitOfWork uow = new UnitOfWork(); Repository <Validator> dataRepository = new Repository <Validator>(uow.ObjectContext); CreateValidator(userName, currentUserName, appID, overrideID, dc, dataRepository, uow); }