SerialNumbers 1.0.0-beta

This is a prerelease version of SerialNumbers.
dotnet add package SerialNumbers --version 1.0.0-beta
                    
NuGet\Install-Package SerialNumbers -Version 1.0.0-beta
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SerialNumbers" Version="1.0.0-beta" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SerialNumbers" Version="1.0.0-beta" />
                    
Directory.Packages.props
<PackageReference Include="SerialNumbers" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SerialNumbers --version 1.0.0-beta
                    
#r "nuget: SerialNumbers, 1.0.0-beta"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SerialNumbers@1.0.0-beta
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SerialNumbers&version=1.0.0-beta&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=SerialNumbers&version=1.0.0-beta&prerelease
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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