public async Task <IActionResult> EditPhoto(string Id) { var photo = await _photoRepo.GetPhoto(Id); var categories = _categoryRepo.GetCategories().Select(cat => new SelectListItem { Text = cat.Name, Value = cat.Name }).ToList(); if (photo == null) { return(RedirectToAction(nameof(Index))); } var model = new PhotoEditViewModel { Name = photo.Name, Description = photo.Description, PhotoUrl = photo.PhotoUrl, Category = photo.Category, FacebookLink = photo.FaceBookLink, InstagramLink = photo.InstagramLink, TwitterLink = photo.TwitterLink, Categories = categories }; return(View(model)); }
public virtual Bitmap GetPhoto() { return(photo.GetPhoto()); }
public IActionResult GetPhoto(uint id) { PhotoEntity photo = _photoService.GetPhoto(id); return((photo != null) ? Ok(photo) : NotFound()); }