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.
Connected.Common/Connected.Common.Numbering/DefaultProvider.cs

24 lines
550 B

2 years ago
using Connected.Annotations;
using Connected.Middleware;
2 years ago
namespace Connected.Common.Numbering;
2 years ago
[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);
}
}