You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using Connected.Annotations;
|
|
|
|
|
using Connected.Middleware;
|
|
|
|
|
|
|
|
|
|
namespace Common.Numbering;
|
|
|
|
|
|
|
|
|
|
[Priority(0)]
|
|
|
|
|
internal sealed class DefaultProvider : MiddlewareComponent, INumberingProvider
|
|
|
|
|
{
|
|
|
|
|
public DefaultProvider(INumberingService numbering)
|
|
|
|
|
{
|
|
|
|
|
Numbering = numbering;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private INumberingService Numbering { get; }
|
|
|
|
|
|
|
|
|
|
public async Task<string> Invoke(NumberingCalculateArgs args)
|
|
|
|
|
{
|
|
|
|
|
if (Numbering is not NumberingService service)
|
|
|
|
|
throw new InvalidCastException(nameof(NumberingService));
|
|
|
|
|
|
|
|
|
|
return await service.NextValue(args);
|
|
|
|
|
}
|
|
|
|
|
}
|