public DerivedCaption[] GetAllDerivedCaptions() { return(ExecuteFaultHandledOperation(() => { var groupNames = new List <string>() { IFRSCoreModuleDefinition.GROUP_ADMINISTRATOR, IFRSCoreModuleDefinition.GROUP_USER }; AllowAccessToOperation(IFRSCoreModuleDefinition.SOLUTION_NAME, groupNames); IDerivedCaptionRepository derivedCaptionRepository = _DataRepositoryFactory.GetDataRepository <IDerivedCaptionRepository>(); IEnumerable <DerivedCaption> derivedCaptions = derivedCaptionRepository.Get().ToArray(); return derivedCaptions.ToArray(); })); }
public DerivedCaption GetDerivedCaption(int derivedCaptionId) { return(ExecuteFaultHandledOperation(() => { var groupNames = new List <string>() { IFRSCoreModuleDefinition.GROUP_ADMINISTRATOR, IFRSCoreModuleDefinition.GROUP_USER }; AllowAccessToOperation(IFRSCoreModuleDefinition.SOLUTION_NAME, groupNames); IDerivedCaptionRepository derivedCaptionRepository = _DataRepositoryFactory.GetDataRepository <IDerivedCaptionRepository>(); DerivedCaption derivedCaptionEntity = derivedCaptionRepository.Get(derivedCaptionId); if (derivedCaptionEntity == null) { NotFoundException ex = new NotFoundException(string.Format("DerivedCaption with ID of {0} is not in database", derivedCaptionId)); throw new FaultException <NotFoundException>(ex, ex.Message); } return derivedCaptionEntity; })); }