Create the .Extensions namespace

This commit is contained in:
Jordan Brown
2020-01-18 19:39:42 -05:00
parent 9406623eb7
commit 8c09521021
7 changed files with 8 additions and 4 deletions
@@ -17,6 +17,7 @@ using Tgstation.Server.Host.Components.Chat;
using Tgstation.Server.Host.Components.Compiler;
using Tgstation.Server.Host.Components.Interop;
using Tgstation.Server.Host.Core;
using Tgstation.Server.Host.Extensions;
namespace Tgstation.Server.Host.Components.Watchdog
{
@@ -15,6 +15,7 @@ using Tgstation.Server.Api.Models;
using Tgstation.Server.Api.Rights;
using Tgstation.Server.Host.Configuration;
using Tgstation.Server.Host.Core;
using Tgstation.Server.Host.Extensions;
using Tgstation.Server.Host.IO;
using Tgstation.Server.Host.Models;
using Tgstation.Server.Host.Security;
@@ -32,6 +32,7 @@ using Tgstation.Server.Host.Components.Repository;
using Tgstation.Server.Host.Components.Watchdog;
using Tgstation.Server.Host.Configuration;
using Tgstation.Server.Host.Controllers;
using Tgstation.Server.Host.Extensions;
using Tgstation.Server.Host.IO;
using Tgstation.Server.Host.Models;
using Tgstation.Server.Host.Security;
@@ -9,7 +9,7 @@ using System.Globalization;
using System.Net;
using Tgstation.Server.Api.Models;
namespace Tgstation.Server.Host.Core
namespace Tgstation.Server.Host.Extensions
{
/// <summary>
/// Extensions for <see cref="IApplicationBuilder"/>
@@ -21,7 +21,7 @@ namespace Tgstation.Server.Host.Core
/// </summary>
/// <param name="httpContext">The <see cref="HttpContext"/> to get the <see cref="ILogger"/> from</param>
/// <returns>A new <see cref="ILogger"/></returns>
static ILogger GetLogger(HttpContext httpContext) => httpContext.RequestServices.GetRequiredService<ILogger<Application>>();
static ILogger GetLogger(HttpContext httpContext) => httpContext.RequestServices.GetRequiredService<ILoggerFactory>().CreateLogger(typeof(ApplicationBuilderExtensions));
/// <summary>
/// Return a <see cref="ConflictObjectResult"/> for <see cref="DbUpdateException"/>s
@@ -4,7 +4,7 @@ using System;
using System.Globalization;
using Tgstation.Server.Host.Configuration;
namespace Tgstation.Server.Host.Core
namespace Tgstation.Server.Host.Extensions
{
/// <summary>
/// Extensions for <see cref="IServiceCollection"/>
@@ -2,7 +2,7 @@
using System.Threading;
using System.Threading.Tasks;
namespace Tgstation.Server.Host.Core
namespace Tgstation.Server.Host.Extensions
{
/// <summary>
/// Extensions for the <see cref="Task"/> <see langword="class"/>.
@@ -3,6 +3,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using System;
using Tgstation.Server.Host.Extensions;
namespace Tgstation.Server.Host.Core.Tests
{