Browse Source

More setup

pull/1240/head
espent1004 5 years ago
parent
commit
dc8fed53f9
5 changed files with 50 additions and 12 deletions
  1. +24
    -0
      src/Services/TenantACustomisations/Infrastructure/AutofacModules/ApplicationModule.cs
  2. +12
    -0
      src/Services/TenantACustomisations/Infrastructure/AutofacModules/MediatorModule.cs
  3. +4
    -5
      src/Services/TenantACustomisations/Infrastructure/Filters/HttpGlobalExceptionFilter.cs
  4. +6
    -3
      src/Services/TenantACustomisations/Startup.cs
  5. +4
    -4
      src/Services/TenantACustomisations/TenantACustomisations.csproj

+ 24
- 0
src/Services/TenantACustomisations/Infrastructure/AutofacModules/ApplicationModule.cs View File

@ -0,0 +1,24 @@
using Autofac;
using System.Reflection;
namespace Microsoft.eShopOnContainers.Services.TenantACustomisations.Infrastructure.AutofacModules
{
public class ApplicationModule
:Autofac.Module
{
public string QueriesConnectionString { get; }
public ApplicationModule(string qconstr)
{
QueriesConnectionString = qconstr;
}
protected override void Load(ContainerBuilder builder)
{
//TODO
}
}
}

+ 12
- 0
src/Services/TenantACustomisations/Infrastructure/AutofacModules/MediatorModule.cs View File

@ -0,0 +1,12 @@
using Autofac;
namespace Microsoft.eShopOnContainers.Services.TenantACustomisations.Infrastructure.AutofacModules
{
public class MediatorModule : Autofac.Module
{
protected override void Load(ContainerBuilder builder)
{
//TODO
}
}
}

+ 4
- 5
src/Services/TenantACustomisations/Infrastructure/Filters/HttpGlobalExceptionFilter.cs View File

@ -1,11 +1,9 @@
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Filters
namespace Microsoft.eShopOnContainers.Services.TenantACustomisations.Infrastructure.Filters
{ {
using AspNetCore.Mvc; using AspNetCore.Mvc;
using global::Ordering.Domain.Exceptions;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.ActionResults;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using System.Net; using System.Net;
@ -26,7 +24,7 @@
context.Exception, context.Exception,
context.Exception.Message); context.Exception.Message);
if (context.Exception.GetType() == typeof(OrderingDomainException))
if (1==2)//TODO
{ {
var problemDetails = new ValidationProblemDetails() var problemDetails = new ValidationProblemDetails()
{ {
@ -54,7 +52,8 @@
// Result asigned to a result object but in destiny the response is empty. This is a known bug of .net core 1.1 // Result asigned to a result object but in destiny the response is empty. This is a known bug of .net core 1.1
// It will be fixed in .net core 1.1.2. See https://github.com/aspnet/Mvc/issues/5594 for more information // It will be fixed in .net core 1.1.2. See https://github.com/aspnet/Mvc/issues/5594 for more information
context.Result = new InternalServerErrorObjectResult(json);
//TODO
//context.Result = new InternalServerErrorObjectResult(json);
context.HttpContext.Response.StatusCode = (int)HttpStatusCode.InternalServerError; context.HttpContext.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
} }
context.ExceptionHandled = true; context.ExceptionHandled = true;


+ 6
- 3
src/Services/TenantACustomisations/Startup.cs View File

@ -1,4 +1,4 @@
namespace Microsoft.eShopOnContainers.Services.Ordering.API
namespace Microsoft.eShopOnContainers.Services.TenantACustomisations
{ {
using AspNetCore.Http; using AspNetCore.Http;
using Autofac; using Autofac;
@ -30,7 +30,9 @@
using HealthChecks.UI.Client; using HealthChecks.UI.Client;
using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.Extensions.Diagnostics.HealthChecks; using Microsoft.Extensions.Diagnostics.HealthChecks;
using TenantACustomisations.Infrastructure.Filters;
using Infrastructure.AutofacModules;
using Microsoft.eShopOnContainers.Services.TenantACustomisations.Infrastructure.Filters;
using global::TenantACustomisations.Infrastructure.Filters;
public class Startup public class Startup
{ {
@ -117,7 +119,8 @@
{ {
if (Configuration.GetValue<bool>("UseLoadTest")) if (Configuration.GetValue<bool>("UseLoadTest"))
{ {
app.UseMiddleware<ByPassAuthMiddleware>();
//app.UseMiddleware<ByPassAuthMiddleware>();
//TODO
} }
app.UseAuthentication(); app.UseAuthentication();


+ 4
- 4
src/Services/TenantACustomisations/TenantACustomisations.csproj View File

@ -48,10 +48,10 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\eShopOnContainersCustomised\src\BuildingBlocks\EventBus\EventBusRabbitMQ\EventBusRabbitMQ.csproj" />
<ProjectReference Include="..\eShopOnContainersCustomised\src\BuildingBlocks\EventBus\EventBusServiceBus\EventBusServiceBus.csproj" />
<ProjectReference Include="..\eShopOnContainersCustomised\src\BuildingBlocks\EventBus\EventBus\EventBus.csproj" />
<ProjectReference Include="..\eShopOnContainersCustomised\src\BuildingBlocks\EventBus\IntegrationEventLogEF\IntegrationEventLogEF.csproj" />
<ProjectReference Include="..\..\BuildingBlocks\EventBus\EventBusRabbitMQ\EventBusRabbitMQ.csproj" />
<ProjectReference Include="..\..\BuildingBlocks\EventBus\EventBusServiceBus\EventBusServiceBus.csproj" />
<ProjectReference Include="..\..\BuildingBlocks\EventBus\EventBus\EventBus.csproj" />
<ProjectReference Include="..\..\BuildingBlocks\EventBus\IntegrationEventLogEF\IntegrationEventLogEF.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>


Loading…
Cancel
Save