Browse Source

Merge branch 'master' into dev

pull/4300/head
Halil İbrahim Kalkan 6 years ago
parent
commit
babae4d9f4
  1. 87
      docs/en/Blob-Storing-Custom-Provider.md
  2. 2
      docs/en/Blob-Storing-File-System.md
  3. 4
      docs/en/Blob-Storing.md
  4. 2
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Carousel.cshtml
  5. 2
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Tables.cshtml

87
docs/en/Blob-Storing-Custom-Provider.md

@ -1,3 +1,88 @@
# BLOB Storing: Creating a Custom Provider
TODO
This document explains how you can create a new storage provider for the BLOB storing system with an example.
> Read the [BLOB Storing document](Blob-Storing.md) to understand how to use the BLOB storing system. This document only covers how to create a new storage provider.
## Example Implementation
The first step is to create a class implements the `IBlobProvider` interface or inherit from the `BlobProviderBase` abstract class.
````csharp
using System.IO;
using System.Threading.Tasks;
using Volo.Abp.BlobStoring;
using Volo.Abp.DependencyInjection;
namespace AbpDemo
{
public class MyCustomBlobProvider : BlobProviderBase, ITransientDependency
{
public override Task SaveAsync(BlobProviderSaveArgs args)
{
//TODO...
}
public override Task<bool> DeleteAsync(BlobProviderDeleteArgs args)
{
//TODO...
}
public override Task<bool> ExistsAsync(BlobProviderExistsArgs args)
{
//TODO...
}
public override Task<Stream> GetOrNullAsync(BlobProviderGetArgs args)
{
//TODO...
}
}
}
````
* `MyCustomBlobProvider` inherits from the `BlobProviderBase` and overrides the `abstract` methods. The actual implementation is up to you.
* Implementing `ITransientDependency` registers this class to the [Dependency Injection](Dependency-Injection.md) system as a transient service.
That's all. Now, you can configure containers (inside the `ConfigureServices` method of your [module](Module-Development-Basics.md)) to use the `MyCustomBlobProvider` class:
````csharp
Configure<AbpBlobStoringOptions>(options =>
{
options.Containers.ConfigureDefault(container =>
{
container.ProviderType = typeof(MyCustomBlobProvider);
});
});
````
> See the [BLOB Storing document](Blob-Storing.md) if you want to configure a specific container.
### BlobContainerConfiguration Extension Method
If you want to provide a simpler configuration, create an extension method for the `BlobContainerConfiguration` class:
````
public static class MyBlobContainerConfigurationExtensions
{
public static BlobContainerConfiguration UseMyCustomBlobProvider(
this BlobContainerConfiguration containerConfiguration)
{
containerConfiguration.ProviderType = typeof(MyCustomBlobProvider);
return containerConfiguration;
}
}
````
Then you can configure containers easier using the extension method:
````csharp
Configure<AbpBlobStoringOptions>(options =>
{
options.Containers.ConfigureDefault(container =>
{
container.UseMyCustomBlobProvider();
});
});
````

2
docs/en/Blob-Storing-File-System.md

@ -2,7 +2,7 @@
File System Storage Provider is used to store BLOBs in the local file system as standard files inside a folder.
> Read the BLOB Storing document to understand how to use the BLOB storing system. This document only covers how to configure containers to use the file system.
> Read the [BLOB Storing document](Blob-Storing.md) to understand how to use the BLOB storing system. This document only covers how to configure containers to use the file system.
## Installation

4
docs/en/Blob-Storing.md

@ -20,9 +20,9 @@ The ABP Framework has already the following storage provider implementations;
* [Database](Blob-Storing-Database.md): Stores BLOBs in a database.
* [Azure](Blob-Storing-Azure.md): Stores BLOBs on the [Azure BLOB storage](https://azure.microsoft.com/en-us/services/storage/blobs/).
More providers will be implemented by the time. You can [request](https://github.com/abpframework/abp/issues/new) it for your favorite provider or [create it yourself](Blob-Storing-Custom-Provider.md).
More providers will be implemented by the time. You can [request](https://github.com/abpframework/abp/issues/new) it for your favorite provider or [create it yourself](Blob-Storing-Custom-Provider.md) and [contribute](Contribution/Index.md) to the ABP Framework.
Multiple providers **can be used together** by the help of the **container system**, where each container can use a different provider (will be explained below).
Multiple providers **can be used together** by the help of the **container system**, where each container can uses a different provider.
> BLOB storing system can not work unless you **configure a storage provider**. Refer to the linked documents for the storage provider configurations.

2
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Carousel.cshtml

@ -25,7 +25,7 @@
<h2>Carousels</h2>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/content/images/" target="_blank"> Bootstrap Carousel</a>.</p>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/components/carousel/" target="_blank"> Bootstrap Carousel</a>.</p>
<h4>Slides only</h4>

2
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Tables.cshtml

@ -25,7 +25,7 @@
<h2>Tables</h2>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/content/Tables/" target="_blank"> Bootstrap Tables</a>.</p>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/content/tables/" target="_blank"> Bootstrap Tables</a>.</p>
<h4>Examples</h4>

Loading…
Cancel
Save