/// <summary> /// Loads the content. /// </summary> public void LoadContent() { string levelsPath = Path.Combine(ApplicationPaths.DataDirectory, "levels.xml"); LevelRepository levelRepository = new LevelRepository(levelsPath); levels = levelRepository.GetAll().ToDomainModels().ToList(); level = levels.FirstOrDefault(x => x.Id == "test"); // TODO: Remove test data }
public List <SelectListItem> GetRegionsByClient(List <int?> ClientIds) { ILevelRepository levelRepo = new LevelRepository(); List <SelectListItem> regionList = new List <SelectListItem>(); regionList = levelRepo.GetAll().Where(x => ClientIds.Contains(x.ClientID) && !string.IsNullOrEmpty(x.Name)).Select(x => new SelectListItem() { Text = x.Name, Value = x.ID.ToString() } ).ToList(); return(regionList); }
public List <SelectListItem> GetAllRegions() { ILevelRepository levelRepo = new LevelRepository(); List <SelectListItem> regionList = new List <SelectListItem>(); regionList = levelRepo.GetAll().Where(x => !string.IsNullOrEmpty(x.Name)).Select(x => new SelectListItem() { Text = x.Name, Value = x.ID.ToString() } ).ToList(); return(regionList); }
// // GET: /Admin/ImportExcel/ public ActionResult Index() { ViewBag.DefaultBranchId = UserContext.GetDefaultBranch(); ViewBag.Collectors = CollectorRepository.GetAll(); ViewBag.Channels = ChannelRepository.GetAll(); ViewBag.SourceTypes = SourceTypeRepository.GetAll(); var levels = LevelRepository.GetAll(); var L1n2 = levels.Where(x => x.LevelId < 3).ToList(); ViewBag.Levels = L1n2; ViewBag.Branches = BranchRepository.GetAll(); return(View()); }
public void GetAll_ShouldWork() { var context = _contextFake .GetContext("GetAll_ShouldWork") .AddFakeLevels(); var levelsFind = context.Levels.ToList(); var repo = new LevelRepository(context); var result = repo.GetAll(); Assert.NotNull(result); Assert.Equal(levelsFind, result, new LevelComparer()); }
public void Should_Return_All_Level_In_Db() { var fakeContext = new FakeContext("GetAllLevel"); fakeContext.FillWith <Level>(); using (var context = new MainContext(fakeContext.FakeOptions)) { var levelCountIndDb = context.Level.Count(); var repository = new LevelRepository(context); Assert.Equal(levelCountIndDb, repository.GetAll().Count()); repository.Dispose(); } }
public void ShouldGetAll() { var fakeContext = new FakeContext("LevelGetAll"); fakeContext.FillWith <Level>(); using (var context = new CentralErrosContext(fakeContext.FakeOptions)) { var expected = fakeContext.GetFakeData <Level>(); var service = new LevelRepository(context); var actual = service.GetAll(); Assert.Equal(expected, actual, new LevelComparer()); } }
// GET api/<controller> public IEnumerable <LevelInfo> Get() { return(LevelRepository.GetAll()); }
public ActionResult <OkResponse <IEnumerable <LevelDto> > > GetAllLevels() { return(new OkResponse <IEnumerable <LevelDto> >(levelRepository.GetAll())); }