Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ilmax committed Aug 25, 2022
1 parent 1d2965e commit 9b5ea54
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
8 changes: 4 additions & 4 deletions AutoNumber/AutoNumber.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<AssemblyTitle>SnowMaker</AssemblyTitle>
<Product>AzureAutoNumber</Product>
<Description>High performance, distributed unique id generator for Azure environments.</Description>
<Version>1.3.3</Version>
<AssemblyVersion>1.3.3.0</AssemblyVersion>
<FileVersion>1.3.3.0</FileVersion>
<Version>1.4.0</Version>
<AssemblyVersion>1.4.0.0</AssemblyVersion>
<FileVersion>1.4.0.0</FileVersion>
<OutputPath>bin\$(Configuration)\</OutputPath>
<Authors>Ali Bahraminezhad</Authors>
<PackageLicenseExpression>MS-PL</PackageLicenseExpression>
Expand All @@ -20,7 +20,7 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageReleaseNotes>Upgrade packages and add support for .NET6</PackageReleaseNotes>
<PackageId>AzureAutoNumber</PackageId>
<PackageVersion>1.3.3</PackageVersion>
<PackageVersion>1.4.0</PackageVersion>
<SignAssembly>False</SignAssembly>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down
3 changes: 0 additions & 3 deletions AutoNumber/BlobOptimisticDataStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,6 @@ private BlockBlobClient InitializeBlobReference(string blockName)

private async Task UploadTextAsync(BlockBlobClient blob, string text, BlobRequestConditions accessCondition)
{
//blob.Properties.ContentType = "utf-8";
//blob.Properties.ContentType = "text/plain";

var header = new BlobHttpHeaders
{
ContentType = "text/plain"
Expand Down
2 changes: 1 addition & 1 deletion AutoNumber/Options/AutoNumberOptionsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public AutoNumberOptionsBuilder UseStorageAccount(string connectionStringOrName)
return this;
}

public AutoNumberOptionsBuilder UseStorageAccount(BlobServiceClient blobServiceClient)
public AutoNumberOptionsBuilder UseBlobServiceClient(BlobServiceClient blobServiceClient)
{
Options.BlobServiceClient = blobServiceClient
?? throw new ArgumentNullException(nameof(blobServiceClient));
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ The project is rely on Azure Blob Storage. `AutoNumber` package will generate id


```
var blobStorageAccount = Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(connectionString);
var blobServiceClient = new BlobServiceClient(connectionString);
var blobOptimisticDataStore = new BlobOptimisticDataStore(blobStorageAccount, "unique-ids");
var blobOptimisticDataStore = new BlobOptimisticDataStore(blobServiceClient, "unique-ids");
var idGen = new UniqueIdGenerator(blobOptimisticDataStore);
Expand All @@ -29,7 +29,7 @@ var id2 = idGen.NextId("orders");
```

### With Microsoft DI
The project has an extension method to add it and its dependencies to Microsoft ASP.NET DI. ~~The only caveat is you need to registry type of `CloudStorageAccount` in DI before registring `AutoNumber`.~~
The project has an extension method to add it and its dependencies to Microsoft ASP.NET DI. ~~The only caveat is you need to registry type of `BlobServiceClient` in DI before registring `AutoNumber`.~~


Use options builder to configure the service, take into account the default settings will read from `appsettings.json`.
Expand All @@ -39,7 +39,7 @@ services.AddAutoNumber(Configuration, x =>
{
return x.UseContainerName("container-name")
.UseStorageAccount("connection-string-or-connection-string-name")
//.UseStorageAccount(cloudStorageAccountInstance)
//.UseBlobServiceClient(blobServiceClient)
.SetBatchSize(10)
.SetMaxWriteAttempts(100)
.Options;
Expand Down

0 comments on commit 9b5ea54

Please sign in to comment.