private List <SelectListItem> GetInterestsAsItems(ApplicationUser user) { var pomInterests = new List <SelectListItem>(); foreach (var item in _interestRepository.GetAll()) { var selectedItem = new SelectListItem() { Text = item.Name, Value = item.InterestId.ToString() }; if (user.Interests.FirstOrDefault(x => x.InterestId == item.InterestId) != null) { selectedItem.Selected = true; } pomInterests.Add(selectedItem); } return(pomInterests); }
public IActionResult GetAllInterests() { return(Ok(_repo.GetAll())); }
public ActionResult GetAllInterests() { var interests = _interestRepository.GetAll(); return(Ok(interests)); }
public ActionResult <IEnumerable <Interest> > GetAllInterests() { var repo = new InterestRepository(); return(repo.GetAll()); }