SerialNumbers 1.0.0-beta
dotnet add package SerialNumbers --version 1.0.0-beta
NuGet\Install-Package SerialNumbers -Version 1.0.0-beta
<PackageReference Include="SerialNumbers" Version="1.0.0-beta" />
<PackageVersion Include="SerialNumbers" Version="1.0.0-beta" />
<PackageReference Include="SerialNumbers" />
paket add SerialNumbers --version 1.0.0-beta
#r "nuget: SerialNumbers, 1.0.0-beta"
#:package SerialNumbers@1.0.0-beta
#addin nuget:?package=SerialNumbers&version=1.0.0-beta&prerelease
#tool nuget:?package=SerialNumbers&version=1.0.0-beta&prerelease
SerialNumbers
Serial Numbers is the C# serial numbers provider. It provides string serial numbers in predefined format.
Changes
You can find last changes in Change Log.
Install
There is only one NuGet packages - SerialNumbers
contains the public API to provide serial numbers business logic.
nuget install SerialNumbers
Application Startup
At the application start we have to configure services to use SerialNumbers components. We can do that using following extensions methods for IServiceCollection
.
var services = new ServiceCollection();
services.AddSerialNumbers(Configuration.GetConnectionString(SerialNumberConstants.SERIAL_NUMBERS_CONNECTION));
services.AddSerialNumbersLocalDateTimeProvider();
-- services.AddSerialNumbersUtcDateTimeProvider();
When services are configured we have to call method BuildSerialNumbersDatabase
to init database by EF migration. We can do that as you can see below.
var serviceProvider = services.BuildServiceProvider();
serviceProvider.BuildSerialNumbersDatabase();
Public API
namespace SerialNumbers.Business
{
/// <summary>
/// Provides public API to manage serial numbers.
/// </summary>
public interface ISerialNumberService
{
/// <summary>
/// Creates the new schema.
/// </summary>
/// <param name="schema">The schema.</param>
/// <param name="customer">The customer.</param>
/// <param name="mask">The mask.</param>
/// <param name="seed">The seed.</param>
/// <param name="increment">The increment.</param>
/// <returns>The created schema.</returns>
ISerialNumberSchema CreateSchema(string schema, string customer, string mask, int seed = 0, int increment = 1);
/// <summary>
/// Gets the current schema value.
/// </summary>
/// <param name="schema">The schema.</param>
/// <param name="customer">The customer.</param>
/// <param name="subject">The subject.</param>
/// <param name="args">The optional arguments.</param>
/// <returns>The current schema value.</returns>
string Current(string schema, string customer, string subject, params string[] args);
/// <summary>
/// Deletes the schema.
/// </summary>
/// <param name="schema">The schema.</param>
/// <param name="customer">The customer.</param>
void DeleteSchema(string schema, string customer);
/// <summary>
/// Gets the schema.
/// </summary>
/// <param name="schema">The schema.</param>
/// <param name="customer">The customer.</param>
/// <returns>The schema.</returns>
ISerialNumberSchema GetSchema(string schema, string customer);
/// <summary>
/// Gets the next schema value.
/// </summary>
/// <param name="schema">The schema.</param>
/// <param name="customer">The customer.</param>
/// <param name="subject">The subject.</param>
/// <param name="args">The optional arguments.</param>
/// <returns>The next schema value.</returns>
string Next(string schema, string customer, string subject, params string[] args);
/// <summary>
/// Resets the specified schema.
/// </summary>
/// <param name="schema">The schema.</param>
/// <param name="customer">The customer.</param>
/// <param name="subject">The subject.</param>
void Reset(string schema, string customer, string subject);
/// <summary>
/// Updates the schema.
/// </summary>
/// <param name="schema">The schema.</param>
/// <param name="customer">The customer.</param>
/// <param name="mask">The mask.</param>
/// <param name="seed">The seed.</param>
/// <param name="increment">The increment.</param>
/// <returns>The updated schema.</returns>
ISerialNumberSchema UpdateSchema(string schema, string customer, string mask, int seed, int increment);
}
}
Usage
TBD
Samples
TBD
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.EntityFrameworkCore (>= 2.0.1)
- Microsoft.EntityFrameworkCore.SqlServer (>= 2.0.1)
- Microsoft.EntityFrameworkCore.Tools (>= 2.0.1)
- Microsoft.Extensions.Configuration (>= 2.0.0)
- Microsoft.Extensions.Configuration.FileExtensions (>= 2.0.0)
- Microsoft.Extensions.Configuration.Json (>= 2.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.0-beta | 1,117 | 12/1/2017 |
First beta version