public GalleryImageEntry GalleryImageEntryGetByID(Guid galleryImageID) { using (PhotoGalleryDataContext db = PhotoGalleryDataContext.GetDataContext()) { GalleryImageEntry ge = (from c in db.tblGalleryImages where c.GalleryImageID == galleryImageID select new GalleryImageEntry(c)).FirstOrDefault(); return(ge); } }
public GalleryImageEntry GalleryImageEntryGetByFilename(Guid galleryID, string galleryImage) { using (PhotoGalleryDataContext db = PhotoGalleryDataContext.GetDataContext()) { GalleryImageEntry ge = (from c in db.tblGalleryImages where c.GalleryID == galleryID && c.GalleryImage.ToLower() == galleryImage.ToLower() orderby c.ImageOrder ascending select new GalleryImageEntry(c)).FirstOrDefault(); return(ge); } }
public override bool Equals(Object obj) { //Check for null and compare run-time types. if (obj == null || GetType() != obj.GetType()) { return(false); } if (obj is GalleryImageEntry) { GalleryImageEntry p = (GalleryImageEntry)obj; return((this.GalleryImageID == p.GalleryImageID) && (this.GalleryID == p.GalleryID) && (this.GalleryImage == p.GalleryImage)); } else { return(false); } }