/// <summary> /// Updates an existing binary property value in the database and the blob storage. /// </summary> /// <param name="value">Binary data to update.</param> /// <param name="dataContext">Database accessor object.</param> /// <returns>A Task that represents the asynchronous operation.</returns> public async Task UpdateBinaryPropertyAsync(BinaryDataValue value, SnDataContext dataContext) { var blobProvider = ProviderSelector.GetProvider(value.Size); await DataProvider.UpdateBinaryPropertyAsync(blobProvider, value, dataContext); dataContext.NeedToCleanupFiles = true; }
/// <summary> /// Deletes a binary property value from the metadata database, making the corresponding blob storage entry orphaned. /// </summary> /// <param name="versionId">Content version id.</param> /// <param name="propertyTypeId">Binary property type id.</param> /// <param name="dataContext">Database accessor object.</param> /// <returns>A Task that represents the asynchronous operation.</returns> public async Task DeleteBinaryPropertyAsync(int versionId, int propertyTypeId, SnDataContext dataContext) { await DataProvider.DeleteBinaryPropertyAsync(versionId, propertyTypeId, dataContext); dataContext.NeedToCleanupFiles = true; }
/// <summary> /// Deletes all binary properties of the requested versions. /// </summary> /// <param name="versionIds">VersionId set.</param> /// <param name="dataContext">Database accessor object.</param> /// <returns>A Task that represents the asynchronous operation.</returns> protected internal static Task DeleteBinaryPropertiesAsync(IEnumerable <int> versionIds, SnDataContext dataContext) { return(BlobStorageComponents.DataProvider.DeleteBinaryPropertiesAsync(versionIds, dataContext)); }
/// <summary> /// Deletes a binary property value from the metadata database, making the corresponding blob storage entry orphaned. /// </summary> /// <param name="versionId">Content version id.</param> /// <param name="propertyTypeId">Binary property type id.</param> /// <param name="dataContext">Database accessor object.</param> /// <returns>A Task that represents the asynchronous operation.</returns> protected internal static Task DeleteBinaryPropertyAsync(int versionId, int propertyTypeId, SnDataContext dataContext) { return(BlobStorageComponents.DataProvider.DeleteBinaryPropertyAsync(versionId, propertyTypeId, dataContext)); }
/// <summary> /// Updates an existing binary property value in the database and the blob storage. /// </summary> /// <param name="value">Binary data to update.</param> /// <param name="dataContext">Database accessor object.</param> /// <returns>A Task that represents the asynchronous operation.</returns> protected internal static Task UpdateBinaryPropertyAsync(BinaryDataValue value, SnDataContext dataContext) { var blobProvider = GetProvider(value.Size); return(BlobStorageComponents.DataProvider.UpdateBinaryPropertyAsync(blobProvider, value, dataContext)); }
/// <summary> /// Inserts a new binary record into the metadata database containing a new or an already exising file id, /// removing the previous record if the content is not new. /// </summary> /// <param name="value">Binary data to insert.</param> /// <param name="versionId">Content version id.</param> /// <param name="propertyTypeId">Binary property type id.</param> /// <param name="isNewNode">Whether this value belongs to a new or an existing node.</param> /// <param name="dataContext">Database accessor object.</param> /// <returns>A Task that represents the asynchronous operation.</returns> protected internal static Task InsertBinaryPropertyAsync(BinaryDataValue value, int versionId, int propertyTypeId, bool isNewNode, SnDataContext dataContext) { var blobProvider = GetProvider(value.Size); if (value.FileId > 0 && value.Stream == null) { return(BlobStorageComponents.DataProvider.InsertBinaryPropertyWithFileIdAsync(value, versionId, propertyTypeId, isNewNode, dataContext)); } else { return(BlobStorageComponents.DataProvider.InsertBinaryPropertyAsync(blobProvider, value, versionId, propertyTypeId, isNewNode, dataContext)); } }
public new static Task UpdateBinaryPropertyAsync(BinaryDataValue value, SnDataContext dataContext) { return(BlobStorageBase.UpdateBinaryPropertyAsync(value, dataContext)); }
/// <summary> /// Inserts a new binary record into the metadata database containing a new or an already existing file id, /// removing the previous record if the content is not new. /// </summary> /// <param name="value">Binary data to insert.</param> /// <param name="versionId">Content version id.</param> /// <param name="propertyTypeId">Binary property type id.</param> /// <param name="isNewNode">Whether this value belongs to a new or an existing node.</param> /// <param name="dataContext">Database accessor object.</param> /// <returns>A Task that represents the asynchronous operation.</returns> public Task InsertBinaryPropertyAsync(BinaryDataValue value, int versionId, int propertyTypeId, bool isNewNode, SnDataContext dataContext) { var blobProvider = ProviderSelector.GetProvider(value.Size); if (value.FileId > 0 && value.Stream == null) { return(DataProvider.InsertBinaryPropertyWithFileIdAsync(value, versionId, propertyTypeId, isNewNode, dataContext)); } else { return(DataProvider.InsertBinaryPropertyAsync(blobProvider, value, versionId, propertyTypeId, isNewNode, dataContext)); } }
/// <summary> /// Deletes all binary properties of the requested versions. /// </summary> /// <param name="versionIds">VersionId set.</param> /// <param name="dataContext">Database accessor object.</param> /// <returns>A Task that represents the asynchronous operation.</returns> protected internal static async Task DeleteBinaryPropertiesAsync(IEnumerable <int> versionIds, SnDataContext dataContext) { await BlobStorageComponents.DataProvider.DeleteBinaryPropertiesAsync(versionIds, dataContext); dataContext.NeedToCleanupFiles = true; }
/// <summary> /// Deletes a binary property value from the metadata database, making the corresponding blob storage entry orphaned. /// </summary> /// <param name="versionId">Content version id.</param> /// <param name="propertyTypeId">Binary property type id.</param> /// <param name="dataContext">Database accessor object.</param> /// <returns>A Task that represents the asynchronous operation.</returns> protected internal static async Task DeleteBinaryPropertyAsync(int versionId, int propertyTypeId, SnDataContext dataContext) { await BlobStorageComponents.DataProvider.DeleteBinaryPropertyAsync(versionId, propertyTypeId, dataContext); dataContext.NeedToCleanupFiles = true; }
/// <summary> /// Updates an existing binary property value in the database and the blob storage. /// </summary> /// <param name="value">Binary data to update.</param> /// <param name="dataContext">Database accessor object.</param> /// <returns>A Task that represents the asynchronous operation.</returns> protected internal static async Task UpdateBinaryPropertyAsync(BinaryDataValue value, SnDataContext dataContext) { var blobProvider = GetProvider(value.Size); await BlobStorageComponents.DataProvider.UpdateBinaryPropertyAsync(blobProvider, value, dataContext); dataContext.NeedToCleanupFiles = true; }
public new static Task <BinaryCacheEntity> LoadBinaryCacheEntityAsync(int nodeVersionId, int propertyTypeId, SnDataContext dataContext) { return(BlobStorageBase.LoadBinaryCacheEntityAsync(nodeVersionId, propertyTypeId, dataContext)); }
public new static Task <BinaryDataValue> LoadBinaryPropertyAsync(int versionId, int propertyTypeId, SnDataContext dataContext) { return(BlobStorageBase.LoadBinaryPropertyAsync(versionId, propertyTypeId, dataContext)); }
public new static Task DeleteBinaryPropertiesAsync(IEnumerable <int> versionIds, SnDataContext dataContext) { return(BlobStorageBase.DeleteBinaryPropertiesAsync(versionIds, dataContext)); }
public new static Task DeleteBinaryPropertyAsync(int versionId, int propertyTypeId, SnDataContext dataContext) { return(BlobStorageBase.DeleteBinaryPropertyAsync(versionId, propertyTypeId, dataContext)); }
/// <summary> /// Deletes all binary properties of the requested versions. /// </summary> /// <param name="versionIds">VersionId set.</param> /// <param name="dataContext">Database accessor object.</param> /// <returns>A Task that represents the asynchronous operation.</returns> public async Task DeleteBinaryPropertiesAsync(IEnumerable <int> versionIds, SnDataContext dataContext) { await DataProvider.DeleteBinaryPropertiesAsync(versionIds, dataContext); dataContext.NeedToCleanupFiles = true; }
/// <summary> /// Loads a cache item into memory that either contains the raw binary (if its size fits into the limit) or /// just the blob metadata pointing to the blob storage. /// </summary> /// <param name="versionId">Content version id.</param> /// <param name="propertyTypeId">Binary property type id.</param> /// <param name="dataContext">Database accessor object.</param> /// <returns>A Task that represents the asynchronous operation /// containig the loaded <see cref="BinaryCacheEntity"/> instance or null.</returns> public Task <BinaryCacheEntity> LoadBinaryCacheEntityAsync(int versionId, int propertyTypeId, SnDataContext dataContext) { return(DataProvider.LoadBinaryCacheEntityAsync(versionId, propertyTypeId, dataContext)); }
/// <summary> /// Loads binary property object without the stream by the given parameters. /// </summary> /// <param name="versionId">Content version id.</param> /// <param name="propertyTypeId">Binary property type id.</param> /// <param name="dataContext">Database accessor object.</param> /// <returns>A Task that represents the asynchronous operation /// containing the loaded <see cref="BinaryDataValue"/> instance or null.</returns> protected static Task <BinaryDataValue> LoadBinaryPropertyAsync(int versionId, int propertyTypeId, SnDataContext dataContext) { return(BlobStorageComponents.DataProvider.LoadBinaryPropertyAsync(versionId, propertyTypeId, dataContext)); }
/// <summary> /// Loads a cache item into memory that either contains the raw binary (if its size fits into the limit) or /// just the blob metadata pointing to the blob storage. /// </summary> /// <param name="versionId">Content version id.</param> /// <param name="propertyTypeId">Binary property type id.</param> /// <param name="dataContext">Database accessor object.</param> /// <returns>A Task that represents the asynchronous operation /// containig the loaded <see cref="BinaryCacheEntity"/> instance or null.</returns> protected internal static Task <BinaryCacheEntity> LoadBinaryCacheEntityAsync(int versionId, int propertyTypeId, SnDataContext dataContext) { return(BlobStorageComponents.DataProvider.LoadBinaryCacheEntityAsync(versionId, propertyTypeId, dataContext)); }
public new static Task InsertBinaryPropertyAsync(BinaryDataValue value, int versionId, int propertyTypeId, bool isNewNode, SnDataContext dataContext) { return(BlobStorageBase.InsertBinaryPropertyAsync(value, versionId, propertyTypeId, isNewNode, dataContext)); }