public void Setup() { _context = new FlickrContext(); _context.Photos.OnError += new LinqExtender.Query <Photo> .ErrorHandler(Photos_OnError); _context.Photos.Comments.OnError += new LinqExtender.Query <Comment> .ErrorHandler(Comments_OnError); }
public ActionResult ADGallery(string icode) { var site = sitesService.GetSiteByCode(icode); FlickrContext context = new FlickrContext(); context.Photos.OnError += new Query <Photo> .ErrorHandler(Photos_OnError); var bigs = (from ph in context.Photos where ph.User == site.flickr_username && ph.PhotoSize == PhotoSize.Default select ph).ToList(); var thumbs = (from ph in context.Photos where ph.User == site.flickr_username && ph.PhotoSize == PhotoSize.Thumbnail select ph).ToList(); var query = from b in bigs join t in thumbs on b.Id equals t.Id select new Image() { Src = t.Url, Alt = b.Url, Id = t.Id, Title = t.Title }; ViewBag.Title = site.title; return(View(query.ToList())); }
private List <Photo> GetPhotos() { FlickrContext fc = new FlickrContext(); var photoStream = (from p in fc.Photos where p.User == FlickrPhotoStreamSetting.Trim() && p.ViewMode == ViewMode.Public && p.PhotoSize == PhotoSize.Square && p.Extras == (ExtrasOption.Media) select p).Take(int.Parse(PhotoCountSetting)); return(photoStream.ToList()); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { FacebookGraph fbUser; if (!StateManager.IsAuthenticated(out fbUser)) { Response.RedirectWithQueryString("Facebook.aspx"); } loggedInName.Text = "Bienvenido, " + fbUser.Name; if (Request.QueryString["icode"] != null) { var site = StateManager.GetSite(Request.QueryString["icode"]); if (site != null) { this.Title = site.title; FlickrContext context = new FlickrContext(); context.Photos.OnError += new Query <Photo> .ErrorHandler(Photos_OnError); var bigs = (from ph in context.Photos where ph.User == site.flickr_username && ph.PhotoSize == PhotoSize.Default select ph).ToList(); var thumbs = (from ph in context.Photos where ph.User == site.flickr_username && ph.PhotoSize == PhotoSize.Thumbnail select ph).ToList(); var query = from b in bigs join t in thumbs on b.Id equals t.Id select new Image() { Src = t.Url, Alt = b.Url, Id = t.Id, Title = t.Title }; rptAlbum.DataSource = query.ToList(); rptAlbum.DataBind(); } else { Response.RedirectWithQueryString("Error.aspx"); } } else { Response.RedirectWithQueryString("Error.aspx"); } } }
public void TeadDown() { context = null; }
public void Setup() { context = new FlickrContext(); context.Photos.OnError += Photos_OnError; context.Photos.Comments.OnError += Comments_OnError; }