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.
16 lines
455 B
16 lines
455 B
using Easy.Snowflakes;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace Easy.Extensions;
|
|
public static class ServiceCollectionServiceExtensions
|
|
{
|
|
public static IServiceCollection AddDriftingSnowflakes(this IServiceCollection services, ushort workId)
|
|
{
|
|
services.AddSingleton(typeof(ISnowflakeIdGenerator), o =>
|
|
{
|
|
return new DriftingSnowflakeIdGenerator(workId);
|
|
});
|
|
|
|
return services;
|
|
}
|
|
}
|