You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update README.md with .NET 10, xUnit, and modern development practices
- Updated features list to mention .NET 8.0/10.0 support
- Added Central Package Management information
- Updated Azure SDK version to 12.27.0
- Removed deprecated DI registration section
- Added Development section with:
* Requirements (.NET 8.0/10.0, Docker)
* Building instructions
* Running tests instructions
* Test framework details (xUnit, TestContainers)
* Central Package Management info
- Fixed typos and improved clarity
- Updated credits to reflect modernization efforts
[](https://www.nuget.org/packages/AzureAutoNumber/)
@@ -12,10 +11,13 @@ High performance, distributed unique thread-safe id generator for Azure.
12
11
- Human-friendly generated ids (number)
13
12
- High performant and fast
14
13
- 100% guarantee that won't cause any duplicate ids
14
+
- Supports .NET 8.0 and .NET 10.0
15
+
- Modern Azure SDK (Azure.Storage.Blobs 12.27.0)
16
+
- Central Package Management
15
17
16
18
## How to use
17
19
18
-
The project is rely on Azure Blob Storage. `AutoNumber` package will generate ids by using a single text file on the Azure Blob Storage.
20
+
The project relies on Azure Blob Storage. `AutoNumber` package will generate ids by using a single text file on the Azure Blob Storage.
19
21
20
22
21
23
```
@@ -32,7 +34,7 @@ var id2 = idGen.NextId("orders");
32
34
```
33
35
34
36
### With Microsoft DI
35
-
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`.~~
37
+
The project has an extension method to add it and its dependencies to Microsoft ASP.NET DI.
36
38
37
39
38
40
Use options builder to configure the service, take into account the default settings will read from `appsettings.json`.
@@ -49,16 +51,6 @@ services.AddAutoNumber(Configuration, x =>
49
51
});
50
52
```
51
53
52
-
53
-
#### Deprecated way to register the service:
54
-
55
-
56
-
```
57
-
// configure the services
58
-
// you need to register an instane of CloudStorageAccount before using this
59
-
serviceCollection.AddAutoNumber();
60
-
```
61
-
62
54
#### Inject `IUniqueIdGenerator` in constructor
63
55
64
56
```
@@ -72,7 +64,7 @@ public class Foo
72
64
```
73
65
74
66
### Configuration
75
-
These are default configuration for `AutoNumber`. If you prefer registering AutoNumber with `AddAddNumber` method, these options can be set via `appsettings.json`.
67
+
These are default configuration for `AutoNumber`. These options can be set via `appsettings.json`.
76
68
77
69
```
78
70
{
@@ -83,9 +75,41 @@ These are default configuration for `AutoNumber`. If you prefer registering Auto
83
75
}
84
76
}
85
77
```
86
-
### Support
87
-
Support this proejct and me via [paypal](https://paypal.me/alibahraminezhad)
78
+
79
+
## Development
80
+
81
+
### Requirements
82
+
- .NET 8.0 SDK or .NET 10.0 SDK
83
+
- Docker (for integration tests)
84
+
85
+
### Building
86
+
```bash
87
+
dotnet build --configuration Release
88
+
```
89
+
90
+
### Running Tests
91
+
```bash
92
+
# Run all tests
93
+
dotnet test --configuration Release
94
+
95
+
# Run only unit tests
96
+
dotnet test UnitTests/UnitTests.csproj --configuration Release
97
+
98
+
# Run integration tests (requires Docker)
99
+
dotnet test IntegrationTests/IntegrationTests.csproj --configuration Release
100
+
```
101
+
102
+
### Test Framework
103
+
-**Unit Tests:** xUnit 2.9.3
104
+
-**Integration Tests:** xUnit 2.9.3 with TestContainers.Azurite
105
+
-**Mocking:** NSubstitute 5.3.0
106
+
107
+
### Central Package Management
108
+
This project uses Central Package Management (CPM). All NuGet package versions are managed in `Directory.Packages.props` at the root level.
109
+
110
+
## Support
111
+
Support this project and me via [PayPal](https://paypal.me/alibahraminezhad)
88
112
89
113
90
114
## Credits
91
-
Most of the credits of this library goes to [Tatham Oddie](https://tatham.blog/2011/07/14/released-snowmaker-a-unique-id-generator-for-azure-or-any-other-cloud-hosting-environment/) for making SnowMaker. I forked his work and made lots of change to make it available on .NET Standard (2.0 and 2.1). SnowMaker is out-dated and is using very old version of Azure Packages.
115
+
Most of the credits of this library goes to [Tatham Oddie](https://tatham.blog/2011/07/14/released-snowmaker-a-unique-id-generator-for-azure-or-any-other-cloud-hosting-environment/) for making SnowMaker. I forked his work and made lots of changes to modernize it with the latest .NET versions and Azure SDK.
0 commit comments