public pb_Photo GetById(Guid photoId) { var photos = db.pb_Photo_GetbyId(photoId).ToList(); if (photos.Count > 0) { return(photos.First()); } else { return(null); } }