Unify some dependency injection in a common library

This commit is contained in:
2021-12-30 23:57:00 -08:00
parent 6a9623d336
commit 8f029a8a34
3 changed files with 28 additions and 4 deletions

View File

@@ -0,0 +1,24 @@
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TwilioSMSReceiver.Common.Handlers;
using TwilioSMSReceiver.Common.Interfaces;
namespace TwilioSMSReceiver.Common.Registrations
{
public static class RegisterDI
{
/// <summary>
/// This registers all dependencies needed to support this app
/// </summary>
/// <param name="provider"></param>
public static void RegisterSMSExtensions(this IServiceCollection provider)
{
provider.AddScoped<IMessageHandler, SMTPHandler>();
provider.AddScoped<IMessageHandler, MSTeamsHandler>();
}
}
}