/// <summary> /// Updates a blob if it already exists. /// If the insert or update lambdas return empty, the blob will be deleted. /// </summary> /// <remarks> /// <para> /// The provided lambdas can be executed multiple times in case of /// concurrency-related retrials, so be careful with side-effects /// (like incrementing a counter in them). /// </para> /// <para>This method is idempotent if and only if the provided lambdas are idempotent.</para> /// </remarks> /// <returns>The value returned by the lambda, or empty if the blob did not exist or was deleted.</returns> public static Maybe <T> UpdateBlobIfExistOrDelete <T>( this IBlobStorageProvider provider, IBlobLocationAndType <T> location, Func <T, Maybe <T> > update, IDataSerializer serializer = null) { return(provider.UpdateBlobIfExistOrDelete(location.ContainerName, location.Path, update, serializer)); }