text-matcher/src/Nocr.TextMatcher.AppServices/ServiceCollectionExtensions.cs
2024-03-23 10:00:12 +04:00

23 lines
800 B
C#

using Microsoft.Extensions.DependencyInjection;
using Nocr.TextMatcher.AppServices.TextMatchers;
using Nocr.TextMatcher.AppServices.TextMatches.Repositories;
using Nocr.TextMatcher.AppServices.TextMatches.Services;
using Rebus.Config;
namespace Nocr.TextMatcher.AppServices;
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddAppServices(this IServiceCollection services)
{
if (services == null)
throw new ArgumentNullException(nameof(services));
// Add registrations here
services.AddRebusHandler<MessageReceivedHandler>();
services.AddScoped<ITextMatchService, TextMatchService>();
services.AddSingleton<ITextMatchRepository, InMemoryTextMatchRepository>();
return services;
}
}