Update to new Perfusion

This commit is contained in:
Nikolay Kochulin 2019-04-18 15:43:57 +03:00
parent 2cd40cb85d
commit bf8778c7d9
6 changed files with 7 additions and 7 deletions

View File

@ -17,7 +17,7 @@ namespace JetKarmaBot
public class JetKarmaBot : IDisposable public class JetKarmaBot : IDisposable
{ {
[Inject] Config Config { get; set; } [Inject] Config Config { get; set; }
[Inject] Container Container { get; set; } [Inject] IContainer Container { get; set; }
[Inject] KarmaContextFactory Db { get; set; } [Inject] KarmaContextFactory Db { get; set; }
TelegramBotClient Client { get; set; } TelegramBotClient Client { get; set; }
@ -70,7 +70,7 @@ namespace JetKarmaBot
Task.Run(() => Commands.Execute(sender, messageEventArgs)); Task.Run(() => Commands.Execute(sender, messageEventArgs));
} }
void InitCommands(Container c) void InitCommands(IContainer c)
{ {
Commands = c.ResolveObject(new ChatCommandRouter(Me)); Commands = c.ResolveObject(new ChatCommandRouter(Me));
Commands.Add(c.ResolveObject(new HelpCommand(Commands))); Commands.Add(c.ResolveObject(new HelpCommand(Commands)));

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp2.1;net47;</TargetFrameworks> <TargetFrameworks>netcoreapp2.1;</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.4"> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.4">

View File

@ -5,7 +5,7 @@ namespace JetKarmaBot.Services
{ {
public class KarmaContextFactory public class KarmaContextFactory
{ {
[Inject] Container C { get; set; } [Inject] IContainer C { get; set; }
public KarmaContext GetContext() => C.GetInstance<KarmaContext>(); public KarmaContext GetContext() => C.GetInstance<KarmaContext>();
} }

View File

@ -14,7 +14,7 @@ namespace JetKarmaBot
private Dictionary<string, Locale> locales = new Dictionary<string, Locale>(); private Dictionary<string, Locale> locales = new Dictionary<string, Locale>();
[Inject] [Inject]
public Localization(Container c) public Localization(IContainer c)
{ {
c.ResolveObject(this); c.ResolveObject(this);
log.Info("Initializing..."); log.Info("Initializing...");

View File

@ -7,7 +7,7 @@ namespace JetKarmaBot
{ {
public class LogInfo : ObjectInfo public class LogInfo : ObjectInfo
{ {
public override object GetInstance(Type requester = null) public override object GetInstance(IContainer c, Type requester = null)
{ {
return LogManager.GetLogger(requester != null ? getTypeName(requester) : "<type unspecified>"); return LogManager.GetLogger(requester != null ? getTypeName(requester) : "<type unspecified>");
} }

@ -1 +1 @@
Subproject commit a9503a6b2cfa9166d4904ad995bc81d39ec9b2b7 Subproject commit 834e1a25e96cbe120789457960c46afdea11f5bc