2020-10-24 23:23:22 +02:00
|
|
|
|
using Birdmap.BLL.Interfaces;
|
|
|
|
|
using Birdmap.BLL.Services;
|
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
namespace Birdmap.BLL
|
|
|
|
|
{
|
|
|
|
|
public static class Startup
|
|
|
|
|
{
|
|
|
|
|
public static IServiceCollection ConfigureBLL(this IServiceCollection services, IConfiguration configuration)
|
|
|
|
|
{
|
|
|
|
|
services.AddTransient<IAuthService, AuthService>();
|
2020-10-25 16:15:06 +01:00
|
|
|
|
services.AddTransient<IUserService, UserService>();
|
2020-11-01 12:25:45 +01:00
|
|
|
|
services.AddTransient<IServiceService, ServiceService>();
|
2020-10-24 23:23:22 +02:00
|
|
|
|
|
2020-11-07 14:19:29 +01:00
|
|
|
|
if (configuration.GetValue<bool>("UseDummyServices"))
|
2020-11-08 18:51:19 +01:00
|
|
|
|
{
|
|
|
|
|
services.AddTransient<IInputService, DummyDeviceAndInputService>();
|
|
|
|
|
services.AddTransient<IDeviceService, DummyDeviceAndInputService>();
|
|
|
|
|
}
|
2020-11-07 14:19:29 +01:00
|
|
|
|
else
|
2020-11-08 18:51:19 +01:00
|
|
|
|
{
|
|
|
|
|
services.AddTransient<IInputService, LiveInputService>();
|
2020-11-07 14:19:29 +01:00
|
|
|
|
services.AddTransient<IDeviceService, LiveDummyService>();
|
2020-11-08 18:51:19 +01:00
|
|
|
|
}
|
2020-11-07 14:19:29 +01:00
|
|
|
|
|
2020-10-24 23:23:22 +02:00
|
|
|
|
return services;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|