last ...
This commit is contained in:
@@ -6,7 +6,10 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using xCommons.Extensions;
|
||||
using xDataService.DI;
|
||||
using xDataService.Models;
|
||||
using xIdentityService.DI;
|
||||
using xMessageService.DI;
|
||||
using xPushService.DI;
|
||||
using xPushService.Helpers;
|
||||
using xServices.Configurations;
|
||||
using xServices.Constants;
|
||||
using xServices.Interfaces;
|
||||
@@ -163,6 +166,19 @@ namespace xServices.DI
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Use Hubs ...
|
||||
//
|
||||
var pushHelper = new XPushServiceHelper();
|
||||
|
||||
//
|
||||
pushHelper.AddHub<XTestDtoHub>("testDto");
|
||||
pushHelper.AddHub<XTestEntityHub>("testEntity");
|
||||
|
||||
//
|
||||
app.UseXPushService(pushHelper);
|
||||
#endregion
|
||||
}
|
||||
|
||||
//
|
||||
@@ -180,7 +196,7 @@ namespace xServices.DI
|
||||
IConfiguration configuration,
|
||||
XServicesConfiguration config = null,
|
||||
IEnumerable<XDatabaseDescriptor> databases = null,
|
||||
ServiceLifetime lifeTime = ServiceLifetime.Transient
|
||||
ServiceLifetime lifeTime = ServiceLifetime.Scoped
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -198,6 +214,14 @@ namespace xServices.DI
|
||||
// Message Service ...
|
||||
services.AddXMessageService(config: configuration);
|
||||
|
||||
//
|
||||
#region Register Identity Service ...
|
||||
// services.AddXIdentityService(
|
||||
// configuration: configuration,
|
||||
// lifeTime: ServiceLifetime.Scoped
|
||||
// );
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Register Data Service ...
|
||||
//
|
||||
@@ -222,6 +246,24 @@ namespace xServices.DI
|
||||
// Register Repository Services ...
|
||||
services.AddScoped<IXTestRepositoryService, XTestRepositoryService>();
|
||||
#endregion
|
||||
|
||||
//
|
||||
#region Register Push Service ...
|
||||
//
|
||||
// Push Service ...
|
||||
services.AddXPushService(
|
||||
config: configuration,
|
||||
lifeTime: ServiceLifetime.Scoped
|
||||
);
|
||||
|
||||
//
|
||||
// Register Provider Services ...
|
||||
// since Hubs required Identity Provider, you Have to Register IdentityService as Requirements ...
|
||||
// a Provider Service, Provides Repository (Entity) or Service (Dto) based
|
||||
// Data Manipulation Actions by Supporting Hub Contexts Events ...
|
||||
services.AddScoped<IXTestServiceProvider, XTestServiceProvider>();
|
||||
services.AddScoped<IXTestRepositoryProvider, XTestRepositoryProvider>();
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user