Skip to content

Commit

Permalink
Made ServiceLocator public
Browse files Browse the repository at this point in the history
to support other DI systems
  • Loading branch information
304NotModified committed Dec 4, 2017
1 parent f5ddd31 commit 98e1847
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions NLog.Web.AspNetCore/AspNetExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
using NLog.Web.Internal;
using NLog.Extensions.Logging;
using NLog.Web.AspNetCore;
using NLog.Web.DependencyInjection;

#if ASP_NET_CORE2
using Microsoft.Extensions.DependencyInjection;
#endif
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.DependencyInjection;

namespace NLog.Web.Internal
namespace NLog.Web.DependencyInjection
{
/// <summary>
/// Service provider
/// </summary>
/// <remarks>
/// This is a anti-pattern, but it works well with NLog
/// This is a anti-pattern, but it works well with NLog, and NLog should also support non-DI
/// </remarks>
internal static class ServiceLocator
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using NLog.LayoutRenderers;
using NLog.Web.DependencyInjection;
using NLog.Web.Internal;

namespace NLog.Web.LayoutRenderers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
using System.Text;

using NLog.LayoutRenderers;

#if ASP_NET_CORE
using NLog.Web.Internal;
using NLog.Web.DependencyInjection;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
#endif

namespace NLog.Web.LayoutRenderers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
#if !ASP_NET_CORE
using System.Web.Hosting;
#else
using NLog.Web.DependencyInjection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
#endif
using NLog.LayoutRenderers;
using NLog.Web.Internal;

namespace NLog.Web.LayoutRenderers
{
Expand Down

0 comments on commit 98e1847

Please sign in to comment.