2022-02-14 00:18:53 +02:00
|
|
|
using Kruzya.TelegramBot.Core;
|
|
|
|
|
using Kruzya.TelegramBot.Core.Service;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using West.TelegramBot.Reputation.Data;
|
|
|
|
|
using West.TelegramBot.Reputation.Service;
|
|
|
|
|
|
2022-02-14 10:21:35 +02:00
|
|
|
namespace West.TelegramBot.Reputation;
|
|
|
|
|
|
|
|
|
|
public class Reputation : Module
|
2022-02-14 00:18:53 +02:00
|
|
|
{
|
2022-02-14 10:21:35 +02:00
|
|
|
public Reputation(Core core) : base(core)
|
2022-02-14 00:18:53 +02:00
|
|
|
{
|
2022-02-14 10:21:35 +02:00
|
|
|
}
|
2022-02-14 00:18:53 +02:00
|
|
|
|
2022-02-14 10:21:35 +02:00
|
|
|
public override void ConfigureServices(IServiceCollection services)
|
|
|
|
|
{
|
|
|
|
|
var dsn = Configuration.GetConnectionString("Reputation");
|
|
|
|
|
services.AddDbContext<ReputationContext>(options => options.UseMySql(dsn, ServerVersion.AutoDetect(dsn)));
|
2022-02-14 00:18:53 +02:00
|
|
|
|
2022-02-14 10:21:35 +02:00
|
|
|
services.AddScoped<IReputation, ReputationService>();
|
2022-02-14 00:18:53 +02:00
|
|
|
}
|
|
|
|
|
}
|