23 lines
800 B
C#
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;
|
|
}
|
|
} |