Commit 586a75bc authored by Steve Smith's avatar Steve Smith Committed by Eric Fleming

Adding list services nuget package (#85)

* Adding list services nuget package
parent 470e52a2
{
"workbench.colorCustomizations": {
"activityBar.background": "#2A226B",
"titleBar.activeBackground": "#3B2F96",
"titleBar.activeForeground": "#FBFAFE"
}
}
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Update="ReportGenerator" Version="4.2.20" /> <PackageReference Update="ReportGenerator" Version="4.2.20" />
<PackageReference Update="Moq" Version="4.13.0" /> <PackageReference Update="Moq" Version="4.13.0" />
<PackageReference Update="Ardalis.ListStartupServices" Version="1.1.3" />
<PackageReference Update="Autofac" Version="4.9.4" /> <PackageReference Update="Autofac" Version="4.9.4" />
<PackageReference Update="Autofac.Extensions.DependencyInjection" Version="5.0.0" /> <PackageReference Update="Autofac.Extensions.DependencyInjection" Version="5.0.0" />
<PackageReference Update="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" /> <PackageReference Update="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" />
......
...@@ -12,7 +12,6 @@ namespace CleanArchitecture.Core.Services ...@@ -12,7 +12,6 @@ namespace CleanArchitecture.Core.Services
Guard.Against.Null(domainEvent, nameof(domainEvent)); Guard.Against.Null(domainEvent, nameof(domainEvent));
// Do Nothing // Do Nothing
return Task.CompletedTask; return Task.CompletedTask;
} }
} }
......
...@@ -18,5 +18,6 @@ ...@@ -18,5 +18,6 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\CleanArchitecture.Core\CleanArchitecture.Core.csproj" /> <ProjectReference Include="..\CleanArchitecture.Core\CleanArchitecture.Core.csproj" />
<ProjectReference Include="..\CleanArchitecture.SharedKernel\CleanArchitecture.SharedKernel.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Ardalis.ListStartupServices" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" PrivateAssets="all" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" PrivateAssets="All" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" PrivateAssets="All" />
<PackageReference Include="Microsoft.Web.LibraryManager.Build" /> <PackageReference Include="Microsoft.Web.LibraryManager.Build" />
......
using CleanArchitecture.Infrastructure; using Ardalis.ListStartupServices;
using CleanArchitecture.Infrastructure;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
...@@ -6,6 +7,7 @@ using Microsoft.Extensions.Configuration; ...@@ -6,6 +7,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.OpenApi.Models; using Microsoft.OpenApi.Models;
using System; using System;
using System.Collections.Generic;
using System.Reflection; using System.Reflection;
namespace CleanArchitecture.Web namespace CleanArchitecture.Web
...@@ -31,15 +33,25 @@ namespace CleanArchitecture.Web ...@@ -31,15 +33,25 @@ namespace CleanArchitecture.Web
services.AddSwaggerGen(c => c.SwaggerDoc("v1", new OpenApiInfo { Title = "My API", Version = "v1" })); services.AddSwaggerGen(c => c.SwaggerDoc("v1", new OpenApiInfo { Title = "My API", Version = "v1" }));
return ContainerSetup.InitializeWeb(Assembly.GetExecutingAssembly(), services); // add list services for diagnostic purposes - see https://github.com/ardalis/AspNetCoreStartupServices
} services.Configure<ServiceConfig>(config =>
{
config.Services = new List<ServiceDescriptor>(services);
// optional - default path to view services is /listallservices - recommended to choose your own path
config.Path = "/listservices";
});
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) return ContainerSetup.InitializeWeb(Assembly.GetExecutingAssembly(), services);
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{ {
if (env.EnvironmentName == "Development") if (env.EnvironmentName == "Development")
{ {
app.UseDeveloperExceptionPage(); app.UseDeveloperExceptionPage();
} app.UseShowAllServicesMiddleware();
}
else else
{ {
app.UseExceptionHandler("/Home/Error"); app.UseExceptionHandler("/Home/Error");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment