public ActionResult PublishedJobAdvert() { ViewBag.Iller = _cityService.GetAll(); ViewBag.Ilce = _townService.GetAll(); ViewBag.Yetenekler = _perfectionService.GetAll(); ViewBag.Egitim = Enum.GetValues(typeof(EducationLevel)); ViewBag.Askerlik = Enum.GetValues(typeof(MilitaryState)); return(View()); }
public async Task GetAll_ShouldReturnCorrectly() { var townName = "test"; var townName2 = "test2"; var town = new Town { Name = townName }; var town2 = new Town { Name = townName2 }; await context.Towns.AddAsync(town); await context.Towns.AddAsync(town2); await context.SaveChangesAsync(); var towns = service.GetAll().ToList(); var expectedTown = new TownServiceModel() { Name = town.Name, Id = town.Id, }; var expectedTown2 = new TownServiceModel() { Name = town2.Name, Id = town2.Id, }; var expectedCategoriesCount = 2; var actualCategoriesCount = towns.Count; Assert.AreEqual(expectedCategoriesCount, actualCategoriesCount); AssertEx.PropertyValuesAreEquals(towns[0], expectedTown); AssertEx.PropertyValuesAreEquals(towns[1], expectedTown2); }
public async Task <IViewComponentResult> InvokeAsync() { var towns = townService.GetAll().OrderBy(t => t.Name).ToList(); return(View(towns)); }
public IEnumerable <Town> GetAll() { return(_townService.GetAll()); }