File tree Expand file tree Collapse file tree
ordering-signalrhub/templates
Infrastructure/AutofacModules Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ app: # app global settings
2727 catalog : catalog # service name for catalog api
2828 ordering : ordering # service name for ordering api
2929 orderingbackgroundtasks : orderingbackgroundtasks # service name for orderingbackgroundtasks
30- orderingsignalrhub : orderingsignalrhub # service name for orderingsignalrhub
30+ orderingsignalrhub : ordering-signalrhub # service name for orderingsignalrhub
3131 identity : identity # service name for identity api
3232 mvc : webmvc # service name for web mvc
3333 spa : webspa # service name for web spa
Original file line number Diff line number Diff line change 1515 all__InstrumentationKey : {{ .Values.inf.appinsights.key }}
1616 all__UseAzureServiceBus : " {{ .Values.inf.eventbus.useAzure }}"
1717 signalr__StoreConnectionString : {{ .Values.inf.redis.keystore.constr }}
18- urls__IdentityUrl : {{ $identity }}
18+ urls__IdentityUrl : http:// {{ $identity }}
Original file line number Diff line number Diff line change 1111 <PackageReference Include =" xunit" Version =" 2.3.1" />
1212 <PackageReference Include =" xunit.runner.visualstudio" Version =" 2.3.1" />
1313 <DotNetCliToolReference Include =" dotnet-xunit" Version =" 2.3.1" />
14- <PackageReference Include =" MediatR" Version =" 4 .1.0" />
14+ <PackageReference Include =" MediatR" Version =" 5 .1.0" />
1515 <PackageReference Include =" Moq" Version =" 4.8.1" />
1616 </ItemGroup >
1717
Original file line number Diff line number Diff line change 1- using Autofac ;
2- using Autofac . Core ;
1+ using System . Linq ;
2+ using System . Reflection ;
3+ using Autofac ;
34using FluentValidation ;
45using MediatR ;
56using Microsoft . eShopOnContainers . Services . Ordering . API . Application . Commands ;
67using Ordering . API . Application . DomainEventHandlers . OrderStartedEvent ;
78using Ordering . API . Application . Validations ;
89using Ordering . API . Infrastructure . Behaviors ;
9- using System . Collections . Generic ;
10- using System . Linq ;
11- using System . Reflection ;
1210
1311namespace Microsoft . eShopOnContainers . Services . Ordering . API . Infrastructure . AutofacModules
1412{
@@ -34,26 +32,14 @@ protected override void Load(ContainerBuilder builder)
3432 . AsImplementedInterfaces ( ) ;
3533
3634
37- builder . Register < SingleInstanceFactory > ( context =>
35+ builder . Register < ServiceFactory > ( context =>
3836 {
3937 var componentContext = context . Resolve < IComponentContext > ( ) ;
4038 return t => { object o ; return componentContext . TryResolve ( t , out o ) ? o : null ; } ;
4139 } ) ;
4240
43- builder . Register < MultiInstanceFactory > ( context =>
44- {
45- var componentContext = context . Resolve < IComponentContext > ( ) ;
46-
47- return t =>
48- {
49- var resolved = ( IEnumerable < object > ) componentContext . Resolve ( typeof ( IEnumerable < > ) . MakeGenericType ( t ) ) ;
50- return resolved ;
51- } ;
52- } ) ;
53-
5441 builder . RegisterGeneric ( typeof ( LoggingBehavior < , > ) ) . As ( typeof ( IPipelineBehavior < , > ) ) ;
5542 builder . RegisterGeneric ( typeof ( ValidatorBehavior < , > ) ) . As ( typeof ( IPipelineBehavior < , > ) ) ;
56-
5743 }
5844 }
5945}
Original file line number Diff line number Diff line change 3131
3232 <ItemGroup >
3333 <PackageReference Include =" FluentValidation.AspNetCore" Version =" 7.5.0" />
34- <PackageReference Include =" MediatR.Extensions.Microsoft.DependencyInjection" Version =" 4 .1.0" />
34+ <PackageReference Include =" MediatR.Extensions.Microsoft.DependencyInjection" Version =" 5 .1.0" />
3535 <PackageReference Include =" Autofac.Extensions.DependencyInjection" Version =" 4.2.1" />
3636 <PackageReference Include =" Microsoft.ApplicationInsights.AspNetCore" Version =" 2.2.1" />
3737 <PackageReference Include =" Microsoft.ApplicationInsights.DependencyCollector" Version =" 2.6.1" />
4040 <PackageReference Include =" Microsoft.Extensions.Configuration.AzureKeyVault" Version =" 2.1.0" />
4141 <PackageReference Include =" Microsoft.Extensions.Logging.AzureAppServices" Version =" 2.1.0" />
4242 <PackageReference Include =" Microsoft.AspNetCore.App" Version =" 2.1.0" />
43- <PackageReference Include =" MediatR" Version =" 4 .1.0" />
43+ <PackageReference Include =" MediatR" Version =" 5 .1.0" />
4444 <PackageReference Include =" Swashbuckle.AspNetCore" Version =" 3.0.0" />
4545 <PackageReference Include =" System.Reflection" Version =" 4.3.0" />
4646 <PackageReference Include =" Dapper" Version =" 1.50.4" />
Original file line number Diff line number Diff line change 55 </PropertyGroup >
66
77 <ItemGroup >
8- <PackageReference Include =" MediatR" Version =" 4.0.1 " />
9- <PackageReference Include =" MediatR.Extensions.Microsoft.DependencyInjection" Version =" 4.0 .0" />
8+ <PackageReference Include =" MediatR" Version =" 5.1.0 " />
9+ <PackageReference Include =" MediatR.Extensions.Microsoft.DependencyInjection" Version =" 5.1 .0" />
1010 <PackageReference Include =" System.Reflection.TypeExtensions" Version =" 4.4.0" />
1111 </ItemGroup >
1212
Original file line number Diff line number Diff line change 1111 <PackageReference Include =" xunit" Version =" 2.3.1" />
1212 <PackageReference Include =" xunit.runner.visualstudio" Version =" 2.3.1" />
1313 <DotNetCliToolReference Include =" dotnet-xunit" Version =" 2.3.1" />
14- <PackageReference Include =" MediatR" Version =" 4 .1.0" />
14+ <PackageReference Include =" MediatR" Version =" 5 .1.0" />
1515 <PackageReference Include =" Moq" Version =" 4.8.1" />
1616 </ItemGroup >
1717
Original file line number Diff line number Diff line change 9696 if (' @User.Identity.IsAuthenticated' === ' True' ) {
9797 var timerId;
9898
99- let connection = stablishConnection ();
100-
101- connection .start ().then (function () {
102- console .log (' User Registered to Signalr Hub' );
103- });
104-
105- registerNotificationHandlers (connection);
99+ stablishConnection ((conn ) => registerNotificationHandlers (conn));
106100 }
107101
108- function stablishConnection () {
109- return new signalR.HubConnectionBuilder ()
102+ function stablishConnection (cb ) {
103+ let connection = new signalR.HubConnectionBuilder ()
110104 .withUrl (' @settings.Value.SignalrHubUrl/hub/notificationhub' , {
111105 transport: signalR .HttpTransportType .LongPolling ,
112106 accessTokenFactory : () => {
113107 return " Authorization" , getToken ();
114108 }
115109 })
116- .build ();
110+ .build ();
111+
112+ connection .start ().then (function () {
113+ console .log (' User Registered to Signalr Hub' );
114+ cb (connection);
115+ });
117116 }
118117
119118 function registerNotificationHandlers (connection ) {
You can’t perform that action at this time.
0 commit comments