public PropertyPhotoGetById ( string stringId ) : |
||
stringId | string | |
return |
public PhotoContent PropertyPhotoGetById(string stringId)
{
var o = ds.Photos.SingleOrDefault(p => p.StringId == stringId);
return (o == null) ? null : Mapper.Map<PhotoContent>(o);
}
public ActionResult Details(string stringId = "") { // Attempt to get the matching object var o = m.PropertyPhotoGetById(stringId); if (o == null) { return(HttpNotFound()); } else { // Return a file content result // Set the Content-Type header, and return the photo bytes return(File(o.Content, o.ContentType)); } }