Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix injection null bug #18

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<IsPackable>true</IsPackable>
<Version>0.0.0.3</Version>
<Version>0.0.0.4</Version>
<Description>logger wrapper</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>log,logger,logging,log4net</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<IsPackable>true</IsPackable>
<Version>0.0.0.3</Version>
<Version>0.0.0.4</Version>
<Description>logger wrapper</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>log,logger,logging</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using EasyMicroservices.Logger.Options;
using EasyMicroservices.Logger.Interfaces;
using EasyMicroservices.Logger.Options;
using System;

namespace Microsoft.Extensions.DependencyInjection
Expand Down Expand Up @@ -29,7 +30,7 @@ public static IServiceCollection AddLoggerScoped(this IServiceCollection service
{
options.ThrowIfNull(nameof(options));
options(new LoggerOption());
services.AddScoped(service => LoggerOptionBuilder.GetLogger());
services.AddScoped<ILoggerProvider>(service => LoggerOptionBuilder.GetLogger());
return services;
}

Expand All @@ -43,7 +44,7 @@ public static IServiceCollection AddLoggerTransient(this IServiceCollection serv
{
options.ThrowIfNull(nameof(options));
options(new LoggerOption());
services.AddTransient(service => LoggerOptionBuilder.GetLogger());
services.AddTransient<ILoggerProvider>(service => LoggerOptionBuilder.GetLogger());
return services;
}

Expand All @@ -57,7 +58,7 @@ public static IServiceCollection AddLoggerSingleton(this IServiceCollection serv
{
options.ThrowIfNull(nameof(options));
options(new LoggerOption());
services.AddSingleton(service => LoggerOptionBuilder.GetLogger());
services.AddSingleton<ILoggerProvider>(service => LoggerOptionBuilder.GetLogger());
return services;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<IsPackable>true</IsPackable>
<Version>0.0.0.3</Version>
<Version>0.0.0.4</Version>
<Description>logger wrapper</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>log,logger,logging,nlog</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Platforms>AnyCPU;x64;x86</Platforms>
<Authors>EasyMicroservices</Authors>
<IsPackable>true</IsPackable>
<Version>0.0.0.3</Version>
<Version>0.0.0.4</Version>
<Description>logger wrapper</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>log,logger,logging,serilog</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0</TargetFrameworks>
<Authors>EasyMicroservices</Authors>
<IsPackable>true</IsPackable>
<Version>0.0.0.3</Version>
<Version>0.0.0.4</Version>
<Description>Logger and Auditing system</Description>
<Copyright>[email protected]</Copyright>
<PackageTags>logging,auditing</PackageTags>
Expand Down