/// <summary> /// Delete the object to which this behavior belongs from the data store and optionally the file system. /// </summary> /// <param name="deleteFromFileSystem">Indicates whether to delete the original file from the hard drive in addition /// to deleting it from the data store. When true, the object is deleted from both the data store and hard drive. When /// false, only the record in the data store and the thumbnail and optimized images are deleted; the original file /// is untouched.</param> public void Delete(bool deleteFromFileSystem) { DeleteFromFileSystem(this._galleryObject, deleteFromFileSystem); //Factory.GetDataProvider().MediaObject_Delete(this._galleryObject); using (var repo = new MediaObjectRepository()) { repo.Delete(this._galleryObject); } }