Browse Source

Merge pull request #40 from dotnet-architecture/dev

upd fork
pull/1934/head
Taras Kovalenko 6 years ago
committed by GitHub
parent
commit
03a824fd90
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 21 additions and 36 deletions
  1. +1
    -1
      k8s/helm/app.yaml
  2. +1
    -1
      k8s/helm/ordering-signalrhub/templates/configmap.yaml
  3. +1
    -1
      src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj
  4. +4
    -18
      src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/MediatorModule.cs
  5. +2
    -2
      src/Services/Ordering/Ordering.API/Ordering.API.csproj
  6. +2
    -2
      src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj
  7. +1
    -1
      src/Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj
  8. +9
    -10
      src/Web/WebMVC/Views/Shared/_Layout.cshtml

+ 1
- 1
k8s/helm/app.yaml View File

@ -27,7 +27,7 @@ app: # app global settings
catalog: catalog # service name for catalog api
ordering: ordering # service name for ordering api
orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks
orderingsignalrhub: orderingsignalrhub # service name for orderingsignalrhub
orderingsignalrhub: ordering-signalrhub # service name for orderingsignalrhub
identity: identity # service name for identity api
mvc: webmvc # service name for web mvc
spa: webspa # service name for web spa


+ 1
- 1
k8s/helm/ordering-signalrhub/templates/configmap.yaml View File

@ -15,4 +15,4 @@ data:
all__InstrumentationKey: {{ .Values.inf.appinsights.key }}
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"
signalr__StoreConnectionString: {{ .Values.inf.redis.keystore.constr }}
urls__IdentityUrl: {{ $identity }}
urls__IdentityUrl: http://{{ $identity }}

+ 1
- 1
src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj View File

@ -11,7 +11,7 @@
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
<PackageReference Include="MediatR" Version="4.1.0" />
<PackageReference Include="MediatR" Version="5.1.0" />
<PackageReference Include="Moq" Version="4.8.1" />
</ItemGroup>


+ 4
- 18
src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/MediatorModule.cs View File

@ -1,14 +1,12 @@
using Autofac;
using Autofac.Core;
using System.Linq;
using System.Reflection;
using Autofac;
using FluentValidation;
using MediatR;
using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands;
using Ordering.API.Application.DomainEventHandlers.OrderStartedEvent;
using Ordering.API.Application.Validations;
using Ordering.API.Infrastructure.Behaviors;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.AutofacModules
{
@ -34,26 +32,14 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Autof
.AsImplementedInterfaces();
builder.Register<SingleInstanceFactory>(context =>
builder.Register<ServiceFactory>(context =>
{
var componentContext = context.Resolve<IComponentContext>();
return t => { object o; return componentContext.TryResolve(t, out o) ? o : null; };
});
builder.Register<MultiInstanceFactory>(context =>
{
var componentContext = context.Resolve<IComponentContext>();
return t =>
{
var resolved = (IEnumerable<object>)componentContext.Resolve(typeof(IEnumerable<>).MakeGenericType(t));
return resolved;
};
});
builder.RegisterGeneric(typeof(LoggingBehavior<,>)).As(typeof(IPipelineBehavior<,>));
builder.RegisterGeneric(typeof(ValidatorBehavior<,>)).As(typeof(IPipelineBehavior<,>));
}
}
}

+ 2
- 2
src/Services/Ordering/Ordering.API/Ordering.API.csproj View File

@ -31,7 +31,7 @@
<ItemGroup>
<PackageReference Include="FluentValidation.AspNetCore" Version="7.5.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="4.1.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="5.1.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.2.1" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.2.1" />
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.6.1" />
@ -40,7 +40,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.AzureKeyVault" Version="2.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.0" />
<PackageReference Include="MediatR" Version="4.1.0" />
<PackageReference Include="MediatR" Version="5.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="3.0.0" />
<PackageReference Include="System.Reflection" Version="4.3.0" />
<PackageReference Include="Dapper" Version="1.50.4" />


+ 2
- 2
src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj View File

@ -5,8 +5,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MediatR" Version="4.0.1" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="4.0.0" />
<PackageReference Include="MediatR" Version="5.1.0" />
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="5.1.0" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.4.0" />
</ItemGroup>


+ 1
- 1
src/Services/Ordering/Ordering.UnitTests/Ordering.UnitTests.csproj View File

@ -11,7 +11,7 @@
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
<PackageReference Include="MediatR" Version="4.1.0" />
<PackageReference Include="MediatR" Version="5.1.0" />
<PackageReference Include="Moq" Version="4.8.1" />
</ItemGroup>


+ 9
- 10
src/Web/WebMVC/Views/Shared/_Layout.cshtml View File

@ -96,24 +96,23 @@
if ('@User.Identity.IsAuthenticated' === 'True') {
var timerId;
let connection = stablishConnection();
connection.start().then(function () {
console.log('User Registered to Signalr Hub');
});
registerNotificationHandlers(connection);
stablishConnection((conn) => registerNotificationHandlers(conn));
}
function stablishConnection() {
return new signalR.HubConnectionBuilder()
function stablishConnection(cb) {
let connection = new signalR.HubConnectionBuilder()
.withUrl('@settings.Value.SignalrHubUrl/hub/notificationhub', {
transport: signalR.HttpTransportType.LongPolling,
accessTokenFactory: () => {
return "Authorization", getToken();
}
})
.build();
.build();
connection.start().then(function () {
console.log('User Registered to Signalr Hub');
cb(connection);
});
}
function registerNotificationHandlers(connection) {


Loading…
Cancel
Save