public LoanSchedule[] GetLoanScheduleDistinctRefNo() { return(ExecuteFaultHandledOperation(() => { var groupNames = new List <string>() { GROUP_ADMINISTRATOR, GROUP_USER }; AllowAccessToOperation(SOLUTION_NAME, groupNames); ILoanScheduleRepository loanScheduleRepository = _DataRepositoryFactory.GetDataRepository <ILoanScheduleRepository>(); IEnumerable <LoanSchedule> loanSchedules = loanScheduleRepository.Get().ToArray(); return loanSchedules.ToArray(); })); }
public LoanSchedule[] GetLoanSchedulebyRefNo(string refNo) { return(ExecuteFaultHandledOperation(() => { var groupNames = new List <string>() { GROUP_ADMINISTRATOR, GROUP_USER }; AllowAccessToOperation(SOLUTION_NAME, groupNames); ILoanScheduleRepository loanScheduleMapRepository = _DataRepositoryFactory.GetDataRepository <ILoanScheduleRepository>(); LoanSchedule[] loanScheduleEntity = loanScheduleMapRepository.Get().Where(c => c.RefNo == refNo).OrderBy(c => c.AMSequence).ToArray(); if (loanScheduleEntity == null) { NotFoundException ex = new NotFoundException(string.Format("LoanSchedule with ID of {0} is not in database", refNo)); throw new FaultException <NotFoundException>(ex, ex.Message); } return loanScheduleEntity; })); }