List <TestMaster> ITestMasterService.GetMasterTests(string name)
 {
     if (string.IsNullOrEmpty(name))
     {
         return(testMasterRepository.GetAll().Where(c => c.IsActive == true).ToList());
     }
     else
     {
         return(testMasterRepository.GetAll().Where(c => c.TestMasterName == name && c.IsActive == true).ToList());
     }
 }
Exemplo n.º 2
0
        IEnumerable <TestMasterViewModel> ITestMasterService.GetMasterTests(string name)
        {
            IEnumerable <TestMasterViewModel> testMasterViewModel;
            IEnumerable <TestMaster>          testMaster;

            //var config = new MapperConfiguration(cfg =>
            //{
            //    cfg.AddProfile<ViewModelProfile>();

            //});

            if (string.IsNullOrEmpty(name))
            {
                testMaster = testMasterRepository.GetAll().Where(c => c.IsActive == true).ToList();
            }
            else
            {
                testMaster = testMasterRepository.GetAll().Where(c => c.TestMasterName == name && c.IsActive == true).ToList();
            }
            testMasterViewModel = _iMapper.Map <IEnumerable <TestMaster>, IEnumerable <TestMasterViewModel> >(testMaster);
            //testMasterViewModel = config.CreateMapper().Map<IEnumerable<TestMaster>, IEnumerable<TestMasterViewModel>>(testMaster);
            return(testMasterViewModel);
        }
 /// <summary>
 /// Get All Test Masters
 /// </summary>
 /// <returns></returns>
 IEnumerable <TestMaster> ITestExpressionService.GetAllTestMasters()
 {
     return(testMasterRepository.GetAll().ToList());
 }