public List<Photo> GetAllPhotos() { var repository = new PhotoRepository(); var photoList = new List<Photo>(); repository.GetAllPhotos().ForEach(x => photoList.Add(new Photo() { ID = x.ID, Description = x.Description })); return photoList; }
public IActionResult Index() { var pics = repository.GetAllPhotos(); return(View(pics)); }
public ActionResult Index() { return(View(PhotoRepository.GetAllPhotos())); }