Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

### How to use

To inject service user extension method `AddYandexObjectStorage` to `IServiceCollection`
To inject service user extension method `AddYandexObjectStorage` to `IServiceCollection`:

```
```C#
services.AddYandexObjectStorage(options =>
{
options.BucketName = "bucketName";
Expand All @@ -21,7 +21,7 @@ services.AddYandexObjectStorage(options =>

Can load options from `IConfiguratiuonRoot` as: `services.AddYandexObjectStorage(Configuration);`
by default, it reads a section with the name `YandexObjectStorage`, for example, the section in `appsettings.json` below:
```
```json
"YandexObjectStorage" : {
"Bucket" : "your-bucket",
"AccessKey" : "your-access-key",
Expand All @@ -32,7 +32,7 @@ by default, it reads a section with the name `YandexObjectStorage`, for example,

Options is a `YandexStorageOptions` class.
It provides access to setup next properties:
```
```C#
string Protocol - by default -> "https"
string BucketName
string Location - by default -> "us-east-1"
Expand All @@ -43,13 +43,13 @@ string SecretKey

## Usage examples

```
```C#
S3PutResponse response = await _objectStoreService.ObjectService.PutAsync(byteArr, fileName);
S3DeleteResponse response = await _objectStoreService.ObjectService.DeleteAsync(filename);
```
Get can return as Stream or ByteArray
Get can return as Stream or ByteArray:

```
```C#
// result is FluentResults wrapped content of result
var result = await _objectStoreService.ObjectService.GetAsync(fileName);
if(result.IsSuccess)
Expand Down