private static List <AlbumPhotoModel> GetAlbumPhotoList(string content, out AlbumPhotoModel cover) { var lst = new List <AlbumPhotoModel>(); cover = new AlbumPhotoModel(); try { var jsonnav = Utils.RemoveHtml(content).Replace("\n", "").Replace(" ", ""); if (jsonnav != "") { lst = Utils.ParseFromJson <List <AlbumPhotoModel> >(jsonnav); cover = lst.OrderByDescending(m => m.IsCover).FirstOrDefault(); } } catch { } return(lst); }
public static void RenderAlbumPhotosPartial(this HtmlHelper <AlbumByYearAndSlugModel> helper) { if (helper == null) { throw new ArgumentNullException("helper"); } for (int i = 1; i <= helper.ViewData.Model.Album.PhotoCount; i++) { var model = new AlbumPhotoModel { Album = helper.ViewData.Model.Album, PhotoItem = i }; helper.RenderPartial(MVC.Albums.Views.AlbumPhoto, model); } }