removed SetCompatibilityVersion as it was deprecated, removed duplicated usings, minor refactoring
This commit is contained in:
parent
d835809dc4
commit
6d26221979
@ -242,11 +242,11 @@ public class Startup
|
||||
var serviceBusPersisterConnection = sp.GetRequiredService<IServiceBusPersisterConnection>();
|
||||
var iLifetimeScope = sp.GetRequiredService<ILifetimeScope>();
|
||||
var logger = sp.GetRequiredService<ILogger<EventBusServiceBus>>();
|
||||
var eventBusSubcriptionsManager = sp.GetRequiredService<IEventBusSubscriptionsManager>();
|
||||
var eventBusSubscriptionsManager = sp.GetRequiredService<IEventBusSubscriptionsManager>();
|
||||
string subscriptionName = Configuration["SubscriptionClientName"];
|
||||
|
||||
return new EventBusServiceBus(serviceBusPersisterConnection, logger,
|
||||
eventBusSubcriptionsManager, iLifetimeScope, subscriptionName);
|
||||
eventBusSubscriptionsManager, iLifetimeScope, subscriptionName);
|
||||
});
|
||||
}
|
||||
else
|
||||
@ -257,7 +257,7 @@ public class Startup
|
||||
var rabbitMQPersistentConnection = sp.GetRequiredService<IRabbitMQPersistentConnection>();
|
||||
var iLifetimeScope = sp.GetRequiredService<ILifetimeScope>();
|
||||
var logger = sp.GetRequiredService<ILogger<EventBusRabbitMQ>>();
|
||||
var eventBusSubcriptionsManager = sp.GetRequiredService<IEventBusSubscriptionsManager>();
|
||||
var eventBusSubscriptionsManager = sp.GetRequiredService<IEventBusSubscriptionsManager>();
|
||||
|
||||
var retryCount = 5;
|
||||
if (!string.IsNullOrEmpty(Configuration["EventBusRetryCount"]))
|
||||
@ -265,7 +265,7 @@ public class Startup
|
||||
retryCount = int.Parse(Configuration["EventBusRetryCount"]);
|
||||
}
|
||||
|
||||
return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubcriptionsManager, subscriptionClientName, retryCount);
|
||||
return new EventBusRabbitMQ(rabbitMQPersistentConnection, logger, iLifetimeScope, eventBusSubscriptionsManager, subscriptionClientName, retryCount);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -4,15 +4,14 @@
|
||||
{
|
||||
public string ExtractRedirectUriFromReturnUrl(string url)
|
||||
{
|
||||
var result = "";
|
||||
var decodedUrl = System.Net.WebUtility.HtmlDecode(url);
|
||||
var results = Regex.Split(decodedUrl, "redirect_uri=");
|
||||
if (results.Length < 2)
|
||||
return "";
|
||||
|
||||
result = results[1];
|
||||
string result = results[1];
|
||||
|
||||
var splitKey = "";
|
||||
string splitKey;
|
||||
if (result.Contains("signin-oidc"))
|
||||
splitKey = "signin-oidc";
|
||||
else
|
||||
|
@ -35,7 +35,7 @@ public class TransactionBehaviour<TRequest, TResponse> : IPipelineBehavior<TRequ
|
||||
{
|
||||
Guid transactionId;
|
||||
|
||||
using var transaction = await _dbContext.BeginTransactionAsync();
|
||||
await using var transaction = await _dbContext.BeginTransactionAsync();
|
||||
using (LogContext.PushProperty("TransactionContext", transaction.TransactionId))
|
||||
{
|
||||
_logger.LogInformation("----- Begin transaction {TransactionId} for {CommandName} ({@Command})", transaction.TransactionId, typeName, request);
|
||||
|
@ -134,8 +134,7 @@ static class CustomExtensionsMethods
|
||||
})
|
||||
// Added for functional tests
|
||||
.AddApplicationPart(typeof(OrdersController).Assembly)
|
||||
.AddJsonOptions(options => options.JsonSerializerOptions.WriteIndented = true)
|
||||
.SetCompatibilityVersion(CompatibilityVersion.Version_3_0);
|
||||
.AddJsonOptions(options => options.JsonSerializerOptions.WriteIndented = true);
|
||||
|
||||
services.AddCors(options =>
|
||||
{
|
||||
|
@ -4,7 +4,6 @@ global using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.Domain.Events;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.Domain.Exceptions;
|
||||
global using System.Collections.Generic;
|
||||
global using System.Linq;
|
||||
global using System.Reflection;
|
||||
|
@ -10,8 +10,4 @@
|
||||
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.7.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -16,8 +16,4 @@
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -72,7 +72,7 @@ public class OrderingContext : DbContext, IUnitOfWork
|
||||
try
|
||||
{
|
||||
await SaveChangesAsync();
|
||||
transaction.Commit();
|
||||
await transaction.CommitAsync();
|
||||
}
|
||||
catch
|
||||
{
|
||||
@ -128,7 +128,7 @@ public class OrderingContextDesignFactory : IDesignTimeDbContextFactory<Ordering
|
||||
return default(IAsyncEnumerable<object?>);
|
||||
}
|
||||
|
||||
public Task Publish<TNotification>(TNotification notification, CancellationToken cancellationToken = default(CancellationToken)) where TNotification : INotification
|
||||
public Task Publish<TNotification>(TNotification notification, CancellationToken cancellationToken = default) where TNotification : INotification
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
@ -138,7 +138,7 @@ public class OrderingContextDesignFactory : IDesignTimeDbContextFactory<Ordering
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task<TResponse> Send<TResponse>(IRequest<TResponse> request, CancellationToken cancellationToken = default(CancellationToken))
|
||||
public Task<TResponse> Send<TResponse>(IRequest<TResponse> request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
return Task.FromResult<TResponse>(default(TResponse));
|
||||
}
|
||||
|
@ -19,10 +19,8 @@ public class BuyerRepository
|
||||
.Add(buyer)
|
||||
.Entity;
|
||||
}
|
||||
else
|
||||
{
|
||||
return buyer;
|
||||
}
|
||||
|
||||
return buyer;
|
||||
}
|
||||
|
||||
public Buyer Update(Buyer buyer)
|
||||
|
@ -22,8 +22,6 @@ global using Microsoft.Extensions.Diagnostics.HealthChecks;
|
||||
global using Microsoft.Extensions.Logging;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.AutofacModules;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents.EventHandling;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents.Events;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents;
|
||||
global using Microsoft.eShopOnContainers.Services.Ordering.SignalrHub;
|
||||
global using RabbitMQ.Client;
|
||||
global using Serilog.Context;
|
||||
|
@ -7,11 +7,7 @@
|
||||
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="wwwroot\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AspNetCore.HealthChecks.AzureServiceBus" Version="5.1.1" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.Rabbitmq" Version="5.0.1" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="5.0.1" />
|
||||
|
@ -52,9 +52,6 @@ public class WebhooksController : ControllerBase
|
||||
return ValidationProblem(ModelState);
|
||||
}
|
||||
|
||||
var userId = _identityService.GetUserIdentity();
|
||||
|
||||
|
||||
var grantOk = await _grantUrlTester.TestGrantUrl(request.Url, request.GrantUrl, request.Token ?? string.Empty);
|
||||
|
||||
if (grantOk)
|
||||
|
@ -22,8 +22,6 @@ public class Startup
|
||||
|
||||
IdentityModelEventSource.ShowPII = true; // Caution! Do NOT use in production: https://aka.ms/IdentityModel/PII
|
||||
|
||||
services.AddControllers();
|
||||
|
||||
services.AddCustomAuthentication(Configuration);
|
||||
}
|
||||
|
||||
|
@ -13,8 +13,8 @@ public class Startup
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
RegisterAppInsights(services);
|
||||
|
||||
services.AddControllers();
|
||||
|
||||
services.AddMvc();
|
||||
|
||||
services.AddOptions();
|
||||
services.AddHealthChecks()
|
||||
@ -23,9 +23,6 @@ public class Startup
|
||||
services
|
||||
.AddHealthChecksUI()
|
||||
.AddInMemoryStorage();
|
||||
|
||||
services.AddMvc()
|
||||
.SetCompatibilityVersion(CompatibilityVersion.Version_3_0);
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
|
@ -21,8 +21,7 @@ public class Startup
|
||||
.AddCustomAuthentication(Configuration)
|
||||
.AddTransient<IWebhooksClient, WebhooksClient>()
|
||||
.AddSingleton<IHooksRepository, InMemoryHooksRepository>()
|
||||
.AddMvc()
|
||||
.SetCompatibilityVersion(CompatibilityVersion.Version_3_0);
|
||||
.AddMvc();
|
||||
|
||||
services.AddControllers();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user