Class SnowflakeIdGeneratorServiceCollectionExtensions
- Namespace
- SnowflakeID
- Assembly
- SnowflakeIDGenerator.DependencyInjection.dll
Extension methods to register SnowflakeIDGenerator services.
public static class SnowflakeIdGeneratorServiceCollectionExtensions
- Inheritance
-
SnowflakeIdGeneratorServiceCollectionExtensions
- Inherited Members
Remarks
Methods
AddSnowflakeIdGeneratorService(IServiceCollection)
Registers a SnowflakeIDGenerator in ISnowflakeIDGenerator.
public static IServiceCollection AddSnowflakeIdGeneratorService(this IServiceCollection serviceCollection)
Parameters
serviceCollectionIServiceCollectionThe IServiceCollection to add services to.
Returns
- IServiceCollection
The updated IServiceCollection.
AddSnowflakeIdGeneratorService(IServiceCollection, SnowflakeIdGeneratorOptions)
Registers a SnowflakeIDGenerator in ISnowflakeIDGenerator.
public static IServiceCollection AddSnowflakeIdGeneratorService(this IServiceCollection serviceCollection, SnowflakeIdGeneratorOptions options)
Parameters
serviceCollectionIServiceCollectionThe IServiceCollection to add services to.
optionsSnowflakeIdGeneratorOptionsOption object. Useful when obtaining from IConfigurationSection.
Returns
- IServiceCollection
The updated IServiceCollection.
AddSnowflakeIdGeneratorService(IServiceCollection, int)
Registers a SnowflakeIDGenerator in ISnowflakeIDGenerator.
public static IServiceCollection AddSnowflakeIdGeneratorService(this IServiceCollection serviceCollection, int machineId)
Parameters
serviceCollectionIServiceCollectionThe IServiceCollection to add services to.
machineIdintMachine number.
Returns
- IServiceCollection
The updated IServiceCollection.
AddSnowflakeIdGeneratorService(IServiceCollection, int, DateTime)
Registers a SnowflakeIDGenerator in ISnowflakeIDGenerator.
public static IServiceCollection AddSnowflakeIdGeneratorService(this IServiceCollection serviceCollection, int machineId, DateTime customEpoch)
Parameters
serviceCollectionIServiceCollectionThe IServiceCollection to add services to.
machineIdintMachine number.
customEpochDateTimeDate to use as epoch.
Returns
- IServiceCollection
The updated IServiceCollection.
AddSnowflakeIdGeneratorService(IServiceCollection, long, DateTime)
Registers a SnowflakeIDGenerator in ISnowflakeIDGenerator.
public static IServiceCollection AddSnowflakeIdGeneratorService(this IServiceCollection serviceCollection, long machineId, DateTime customEpoch)
Parameters
serviceCollectionIServiceCollectionThe IServiceCollection to add services to.
machineIdlongMachine number.
customEpochDateTimeDate to use as epoch.
Returns
- IServiceCollection
The updated IServiceCollection.
AddSnowflakeIdGeneratorService(IServiceCollection, ulong)
Registers a SnowflakeIDGenerator in ISnowflakeIDGenerator.
public static IServiceCollection AddSnowflakeIdGeneratorService(this IServiceCollection serviceCollection, ulong machineId)
Parameters
serviceCollectionIServiceCollectionThe IServiceCollection to add services to.
machineIdulongMachine number.
Returns
- IServiceCollection
The updated IServiceCollection.
AddSnowflakeIdGeneratorService(IServiceCollection, ulong, DateTime)
Registers a SnowflakeIDGenerator in ISnowflakeIDGenerator.
public static IServiceCollection AddSnowflakeIdGeneratorService(this IServiceCollection serviceCollection, ulong machineId, DateTime customEpoch)
Parameters
serviceCollectionIServiceCollectionThe IServiceCollection to add services to.
machineIdulongMachine number.
customEpochDateTimeDate to use as epoch.
Returns
- IServiceCollection
The updated IServiceCollection.