2024-06-09 14:30:53 +00:00
|
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Questionable.Controller.Steps;
|
|
|
|
|
|
|
|
|
|
namespace Questionable;
|
|
|
|
|
|
|
|
|
|
internal static class ServiceCollectionExtensions
|
|
|
|
|
{
|
2024-08-20 00:48:06 +00:00
|
|
|
|
public static void AddTaskFactory<
|
|
|
|
|
[MeansImplicitUse(ImplicitUseKindFlags.InstantiatedNoFixedConstructorSignature)] TFactory>(
|
2024-06-09 14:30:53 +00:00
|
|
|
|
this IServiceCollection serviceCollection)
|
|
|
|
|
where TFactory : class, ITaskFactory
|
|
|
|
|
{
|
|
|
|
|
serviceCollection.AddSingleton<ITaskFactory, TFactory>();
|
2024-08-20 00:48:06 +00:00
|
|
|
|
serviceCollection.AddSingleton<TFactory>();
|
2024-06-09 14:30:53 +00:00
|
|
|
|
}
|
|
|
|
|
}
|