public static GetAllCohortsDataResponse GetCohorts(GetAllCohortsDataRequest request) { GetAllCohortsDataResponse response = new GetAllCohortsDataResponse(); ICohortRepository <API.DataDomain.Cohort.DTO.CohortData> repo = CohortRepositoryFactory <API.DataDomain.Cohort.DTO.CohortData> .GetCohortRepository(request.ContractNumber, request.Context, request.UserId); List <API.DataDomain.Cohort.DTO.CohortData> cohorts = repo.SelectAll() as List <API.DataDomain.Cohort.DTO.CohortData>; if (cohorts != null) { response.Cohorts = cohorts.ToList(); } return(response); }
public void GetAllCohorts_Test() { // Arrange double version = 1.0; string contractNumber = "InHealth001"; string context = "NG"; GetAllCohortsDataRequest request = new GetAllCohortsDataRequest { Context = context, ContractNumber = contractNumber, Version = version }; // Act GetAllCohortsDataResponse response = DataCohortManager.GetCohorts(request); // Assert Assert.AreNotEqual(0, response.Cohorts.Count); }
public GetAllCohortsDataResponse Get(GetAllCohortsDataRequest request) { GetAllCohortsDataResponse response = new GetAllCohortsDataResponse(); try { if (string.IsNullOrEmpty(request.UserId)) { throw new UnauthorizedAccessException("CohortDD:Get()::Unauthorized Access"); } response = DataCohortManager.GetCohorts(request); response.Version = request.Version; } catch (Exception ex) { CommonFormatter.FormatExceptionResponse(response, base.Response, ex); string aseProcessID = ConfigurationManager.AppSettings.Get("ASEProcessID") ?? "0"; Common.Helper.LogException(int.Parse(aseProcessID), ex); } return(response); }