2052 lines
67 KiB
Plaintext
2052 lines
67 KiB
Plaintext
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Configurations\Entities\XWebinarEntityConfiguration.cs
|
|
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
using xDataService.Providers;
|
|
using xWebinarService.Constants;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Configurations.Entities
|
|
{
|
|
public class XWebinarEntityConfiguration : XBaseEntityTypeConfiguration<XWebinar, Guid>
|
|
{
|
|
public override void Configure(EntityTypeBuilder<XWebinar> builder)
|
|
{
|
|
builder.ToTable(XWebinarServiceConstants.XWebinarTable);
|
|
}
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Configurations\Entities\XWebinarSubscriberEntityConfiguration.cs
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
using xDataService.Providers;
|
|
using xWebinarService.Constants;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Configurations.Entities
|
|
{
|
|
public class XWebinarSubscriberEntityConfiguration : XBaseEntityTypeConfiguration<XWebinarSubscriber, int>
|
|
{
|
|
public override void Configure(EntityTypeBuilder<XWebinarSubscriber> builder)
|
|
{
|
|
builder.ToTable(XWebinarServiceConstants.XWebinarSubscriberTable);
|
|
}
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Constants\XWebinarServiceConstants.cs
|
|
|
|
namespace xWebinarService.Constants
|
|
{
|
|
public struct XWebinarServiceConstants
|
|
{
|
|
//
|
|
// Service Extensions Log Tag ...
|
|
public const string XWebinarServiceDILogTag = "XWebinarService";
|
|
|
|
//
|
|
// Table Mapping Identifiers ...
|
|
public const string XWebinarTable = "Webinars";
|
|
public const string XWebinarSubscriberTable = "WebinarSubscribers";
|
|
|
|
//
|
|
// GraphQL Collection Mappings ...
|
|
public const string XWebinarSingleName = "webinar";
|
|
public const string XWebinarCollectionName = "webinars";
|
|
|
|
public const string XWebinarSubscriberSingleName = "webinarSubscriber";
|
|
public const string XWebinarSubscriberCollectionName = "webinarSubscribers";
|
|
|
|
//
|
|
// Hubs ...
|
|
public const string XWebinarDtoHub = "webinarDto";
|
|
public const string XWebinarEntityHub = "webinarEntity";
|
|
public const string XWebinarSubscriberDtoHub = "webinarSubscriberDto";
|
|
public const string XWebinarSubscriberEntityHub = "webinarSubscriberEntity";
|
|
|
|
//
|
|
// Custome Constants ...
|
|
|
|
//
|
|
// EF Repositories Helper Extensions ...
|
|
public const string GetXWebinarEFRepositoryDescriptor = "GetXWebinarEFRepositoryDescriptor";
|
|
public const string GetXWebinarSubscriberEFRepositoryDescriptor = "GetXWebinarSubscriberEFRepositoryDescriptor";
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Constants\XWebinarType.cs
|
|
|
|
using xExceptions.Attributes;
|
|
|
|
namespace xWebinarService.Constants
|
|
{
|
|
/// <summary>
|
|
/// Webinar Type ...
|
|
/// </summary>
|
|
public enum XWebinarType
|
|
{
|
|
[StringValue("Public")]
|
|
Public = 0,
|
|
[StringValue("Private")]
|
|
Private = 1
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\DI\XDIHelperExtension.cs
|
|
|
|
using System;
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using xCommons.Extensions;
|
|
using xCommons.Helpers;
|
|
using xDataService.Constants;
|
|
using xDataService.Db;
|
|
using xDataService.DI;
|
|
using xDataService.Models;
|
|
using xExceptions.Constants;
|
|
using xPushService.DI;
|
|
using xPushService.Helpers;
|
|
using xWebinarService.Constants;
|
|
using xWebinarService.Helpers;
|
|
using xWebinarService.Interfaces.Dtos;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Providers.Dtos;
|
|
using xWebinarService.Providers.Entities;
|
|
|
|
namespace xWebinarService.DI
|
|
{
|
|
public static class XDIHelperExtension
|
|
{
|
|
/// <summary>
|
|
/// Register Service ...
|
|
/// </summary>
|
|
/// <param name="services"></param>
|
|
/// <param name="repositoryType"></param>
|
|
/// <param name="lifeTime"></param>
|
|
public static void AddXWebinarService(
|
|
this IServiceCollection services,
|
|
XRepositoryType repositoryType,
|
|
ServiceLifetime lifeTime = ServiceLifetime.Scoped
|
|
)
|
|
{
|
|
AddWebinarService(
|
|
contextType: null,
|
|
services: services,
|
|
lifeTime: lifeTime,
|
|
repositoryType: repositoryType
|
|
);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Register Service ...
|
|
/// </summary>
|
|
/// <typeparam name="TContext"></typeparam>
|
|
/// <param name="services"></param>
|
|
/// <param name="repositoryType"></param>
|
|
/// <param name="lifeTime"></param>
|
|
public static void AddXWebinarService<TContext>(
|
|
this IServiceCollection services,
|
|
XRepositoryType repositoryType,
|
|
ServiceLifetime lifeTime = ServiceLifetime.Scoped
|
|
)
|
|
where TContext : XDbContext
|
|
{
|
|
AddWebinarService(
|
|
services: services,
|
|
lifeTime: lifeTime,
|
|
contextType: typeof(TContext),
|
|
repositoryType: repositoryType
|
|
);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Use XWebinarService Middleware ...
|
|
/// </summary>
|
|
/// <param name="app"></param>
|
|
/// <param name="isDevelopmentEnvironment"></param>
|
|
public static void UsexWebinarService(
|
|
this IApplicationBuilder app,
|
|
bool isDevelopmentEnvironment = false
|
|
)
|
|
{
|
|
//
|
|
#region Using XWebinar Hubs ...
|
|
//
|
|
var pushHelper = new XPushServiceHelper();
|
|
|
|
//
|
|
pushHelper.AddHub<XWebinarDtoHub>(XWebinarServiceConstants.XWebinarDtoHub);
|
|
pushHelper.AddHub<XWebinarEntityHub>(XWebinarServiceConstants.XWebinarEntityHub);
|
|
|
|
//
|
|
pushHelper.AddHub<XWebinarSubscriberDtoHub>(XWebinarServiceConstants.XWebinarSubscriberDtoHub);
|
|
pushHelper.AddHub<XWebinarSubscriberEntityHub>(XWebinarServiceConstants.XWebinarSubscriberEntityHub);
|
|
|
|
//
|
|
app.UseXPushService(pushHelper);
|
|
#endregion
|
|
|
|
//
|
|
// Using XWebinar Repository Descriptor ...
|
|
if (!webinarDescriptor.IsNull())
|
|
{
|
|
//
|
|
app.UseXRepository(
|
|
descriptor: webinarDescriptor,
|
|
isDevelopmentEnvironment: isDevelopmentEnvironment
|
|
);
|
|
}
|
|
|
|
//
|
|
// Using XWebinarSubscriber Repository Descriptor ...
|
|
if (!webinarSubscriberDescriptor.IsNull())
|
|
{
|
|
//
|
|
app.UseXRepository(
|
|
descriptor: webinarSubscriberDescriptor,
|
|
isDevelopmentEnvironment: isDevelopmentEnvironment
|
|
);
|
|
}
|
|
}
|
|
|
|
//
|
|
#region Private ...
|
|
private static XRepositoryDescriptor webinarDescriptor = null;
|
|
private static XRepositoryDescriptor webinarSubscriberDescriptor = null;
|
|
|
|
/// <summary>
|
|
/// a LogTag for Service ...
|
|
/// </summary>
|
|
private static string XLogTag = XWebinarServiceConstants.XWebinarServiceDILogTag;
|
|
|
|
/// <summary>
|
|
/// print a log in Console ...
|
|
/// </summary>
|
|
/// <param name="message"></param>
|
|
private static void Log(string message)
|
|
{
|
|
Console.WriteLine($"{XLogTag} => {message}");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Register Service ...
|
|
/// </summary>
|
|
/// <param name="services"></param>
|
|
/// <param name="repositoryType"></param>
|
|
/// <param name="contextType"></param>
|
|
/// <param name="lifeTime"></param>
|
|
private static void AddWebinarService(
|
|
IServiceCollection services,
|
|
XRepositoryType repositoryType,
|
|
Type contextType = null,
|
|
ServiceLifetime lifeTime = ServiceLifetime.Scoped
|
|
)
|
|
{
|
|
//
|
|
var exception = XException.InvalidArgs.ToException(); ;
|
|
|
|
//
|
|
// Services ...
|
|
var isServicesExists = !services.IsNull();
|
|
if (!isServicesExists)
|
|
{
|
|
//
|
|
Log("Service Registration failed, services not provided ...");
|
|
throw exception;
|
|
}
|
|
|
|
//
|
|
// Lifetime ...
|
|
var isLifetimeExists = !lifeTime.IsNull();
|
|
if (!isLifetimeExists)
|
|
{
|
|
//
|
|
Log("Service Registration failed, lifetime not provided ...");
|
|
throw exception;
|
|
}
|
|
|
|
//
|
|
// Validate Repository Type ...
|
|
var isRepositoryTypeValid =
|
|
(repositoryType == XRepositoryType.EF &&
|
|
!contextType.IsNull()) ||
|
|
((repositoryType == XRepositoryType.Mongo ||
|
|
repositoryType == XRepositoryType.InMemory) &&
|
|
contextType.IsNull());
|
|
if (!isRepositoryTypeValid)
|
|
{
|
|
//
|
|
Log("Service Registration failed, Invalid Repository Type and Context Type ...");
|
|
throw exception;
|
|
}
|
|
|
|
//
|
|
// Maske Instance of Repository Descriptor
|
|
// Based on Provided Type ...
|
|
switch (repositoryType)
|
|
{
|
|
//
|
|
case XRepositoryType.EF:
|
|
//
|
|
webinarDescriptor = typeof(XWebinarServiceHelper)
|
|
.InvokeGenericMethod<XRepositoryDescriptor>(
|
|
args: null,
|
|
runtimeType: contextType,
|
|
methodName: XWebinarServiceConstants.GetXWebinarEFRepositoryDescriptor
|
|
);
|
|
|
|
//
|
|
webinarSubscriberDescriptor = typeof(XWebinarServiceHelper)
|
|
.InvokeGenericMethod<XRepositoryDescriptor>(
|
|
args: null,
|
|
runtimeType: contextType,
|
|
methodName: XWebinarServiceConstants.GetXWebinarSubscriberEFRepositoryDescriptor
|
|
);
|
|
break;
|
|
|
|
//
|
|
case XRepositoryType.Mongo:
|
|
webinarDescriptor = XWebinarServiceHelper.GetXWebinarMongoRepositoryDescriptor();
|
|
webinarSubscriberDescriptor = XWebinarServiceHelper.GetXWebinarSubscriberMongoRepositoryDescriptor();
|
|
break;
|
|
|
|
//
|
|
case XRepositoryType.InMemory:
|
|
webinarDescriptor = XWebinarServiceHelper.GetXWebinarInMemoryRepositoryDescriptor();
|
|
webinarSubscriberDescriptor = XWebinarServiceHelper.GetXWebinarSubscriberInMemoryRepositoryDescriptor();
|
|
break;
|
|
}
|
|
|
|
//
|
|
// Register xWebinar Repository Descriptor ...
|
|
services.AddXRepository(
|
|
lifeTime: lifeTime,
|
|
descriptor: webinarDescriptor
|
|
);
|
|
|
|
services.AddXRepository(
|
|
lifeTime: lifeTime,
|
|
descriptor: webinarSubscriberDescriptor
|
|
);
|
|
|
|
//
|
|
// Register Dto Services ...
|
|
services.Add(
|
|
new ServiceDescriptor(typeof(IXWebinarServiceProvider), typeof(XWebinarServiceProvider), lifeTime)
|
|
);
|
|
services.Add(
|
|
new ServiceDescriptor(typeof(IXWebinarRepositoryService), typeof(XWebinarRepositoryService), lifeTime)
|
|
);
|
|
services.Add(
|
|
new ServiceDescriptor(typeof(IXWebinarRepositoryProvider), typeof(XWebinarRepositoryProvider), lifeTime)
|
|
);
|
|
|
|
services.Add(
|
|
new ServiceDescriptor(typeof(IXWebinarSubscriberServiceProvider), typeof(XWebinarSubscriberServiceProvider), lifeTime)
|
|
);
|
|
services.Add(
|
|
new ServiceDescriptor(typeof(IXWebinarSubscriberRepositoryService), typeof(XWebinarSubscriberRepositoryService), lifeTime)
|
|
);
|
|
services.Add(
|
|
new ServiceDescriptor(typeof(IXWebinarSubscriberRepositoryProvider), typeof(XWebinarSubscriberRepositoryProvider), lifeTime)
|
|
);
|
|
|
|
//
|
|
// services.Add(
|
|
// new ServiceDescriptor(typeof(IXWebinarProvider), typeof(XWebinarProvider), lifeTime)
|
|
// );
|
|
|
|
//
|
|
Log("Service Regitration Succeed ...");
|
|
}
|
|
#endregion
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Helpers\XWebinarServiceHelper.cs
|
|
|
|
using System;
|
|
using GraphQL.Types;
|
|
using xDataService.Db;
|
|
using xDataService.Models;
|
|
using xDataService.Providers;
|
|
using xWebinarService.Interfaces;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
using xWebinarService.Providers.Entities;
|
|
using xWebinarService.Providers.GraphQL;
|
|
|
|
namespace xWebinarService.Helpers
|
|
{
|
|
public static class XWebinarServiceHelper
|
|
{
|
|
//
|
|
#region XWebinar ...
|
|
//
|
|
#region EF Repository Descriptor Provider(s) ...
|
|
public static XEFRepositoryDescriptor<
|
|
XWebinar,
|
|
Guid,
|
|
IXWebinarKeyGenerator,
|
|
XWebinarKeyGenerator,
|
|
IXWebinarRepositoryEvents,
|
|
XWebinarRepositoryEvents,
|
|
XWebinarGraphType,
|
|
GuidGraphType,
|
|
XWebinarGraphQuery,
|
|
IXWebinarGraphQLTypeHelper,
|
|
XWebinarGraphQLTypeHelper,
|
|
XWebinarGraphSchema,
|
|
IXWebinarRepository,
|
|
XWebinarEFRepository<TContext>,
|
|
TContext
|
|
> GetXWebinarEFRepositoryDescriptor<TContext>()
|
|
where TContext : XDbContext
|
|
{
|
|
//
|
|
var result = new XEFRepositoryDescriptor<
|
|
XWebinar,
|
|
Guid,
|
|
IXWebinarKeyGenerator,
|
|
XWebinarKeyGenerator,
|
|
IXWebinarRepositoryEvents,
|
|
XWebinarRepositoryEvents,
|
|
XWebinarGraphType,
|
|
GuidGraphType,
|
|
XWebinarGraphQuery,
|
|
IXWebinarGraphQLTypeHelper,
|
|
XWebinarGraphQLTypeHelper,
|
|
XWebinarGraphSchema,
|
|
IXWebinarRepository,
|
|
XWebinarEFRepository<TContext>,
|
|
TContext
|
|
>();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
public static XEFRepositoryDescriptor<
|
|
XWebinar,
|
|
Guid,
|
|
IXWebinarKeyGenerator,
|
|
XWebinarKeyGenerator,
|
|
IXWebinarRepositoryEvents,
|
|
XWebinarRepositoryEvents,
|
|
XWebinarGraphType,
|
|
GuidGraphType,
|
|
XWebinarGraphQuery,
|
|
IXWebinarGraphQLTypeHelper,
|
|
XWebinarGraphQLTypeHelper,
|
|
XWebinarGraphSchema,
|
|
IXWebinarRepository,
|
|
XWebinarEFRepository<TContext>,
|
|
TContext,
|
|
IXWebinarSeeder,
|
|
TSeederImplementation
|
|
> GetXWebinarEFRepositoryDescriptor<TContext, TSeederImplementation>()
|
|
where TContext : XDbContext
|
|
where TSeederImplementation : XBaseDbSeeder<XWebinar, Guid>
|
|
{
|
|
//
|
|
var result = new XEFRepositoryDescriptor<
|
|
XWebinar,
|
|
Guid,
|
|
IXWebinarKeyGenerator,
|
|
XWebinarKeyGenerator,
|
|
IXWebinarRepositoryEvents,
|
|
XWebinarRepositoryEvents,
|
|
XWebinarGraphType,
|
|
GuidGraphType,
|
|
XWebinarGraphQuery,
|
|
IXWebinarGraphQLTypeHelper,
|
|
XWebinarGraphQLTypeHelper,
|
|
XWebinarGraphSchema,
|
|
IXWebinarRepository,
|
|
XWebinarEFRepository<TContext>,
|
|
TContext,
|
|
IXWebinarSeeder,
|
|
TSeederImplementation
|
|
>();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
//
|
|
#region Mongo Repository Descriptor Provider(s) ...
|
|
public static XMongoRepositoryDescriptor<
|
|
XWebinar,
|
|
Guid,
|
|
IXWebinarKeyGenerator,
|
|
XWebinarKeyGenerator,
|
|
IXWebinarRepositoryEvents,
|
|
XWebinarRepositoryEvents,
|
|
XWebinarGraphType,
|
|
GuidGraphType,
|
|
XWebinarGraphQuery,
|
|
IXWebinarGraphQLTypeHelper,
|
|
XWebinarGraphQLTypeHelper,
|
|
XWebinarGraphSchema,
|
|
IXWebinarRepository,
|
|
XWebinarMongoRepository
|
|
> GetXWebinarMongoRepositoryDescriptor()
|
|
{
|
|
//
|
|
var result = new XMongoRepositoryDescriptor<
|
|
XWebinar,
|
|
Guid,
|
|
IXWebinarKeyGenerator,
|
|
XWebinarKeyGenerator,
|
|
IXWebinarRepositoryEvents,
|
|
XWebinarRepositoryEvents,
|
|
XWebinarGraphType,
|
|
GuidGraphType,
|
|
XWebinarGraphQuery,
|
|
IXWebinarGraphQLTypeHelper,
|
|
XWebinarGraphQLTypeHelper,
|
|
XWebinarGraphSchema,
|
|
IXWebinarRepository,
|
|
XWebinarMongoRepository
|
|
>();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
public static XMongoRepositoryDescriptor<
|
|
XWebinar,
|
|
Guid,
|
|
IXWebinarKeyGenerator,
|
|
XWebinarKeyGenerator,
|
|
IXWebinarRepositoryEvents,
|
|
XWebinarRepositoryEvents,
|
|
XWebinarGraphType,
|
|
GuidGraphType,
|
|
XWebinarGraphQuery,
|
|
IXWebinarGraphQLTypeHelper,
|
|
XWebinarGraphQLTypeHelper,
|
|
XWebinarGraphSchema,
|
|
IXWebinarRepository,
|
|
XWebinarMongoRepository,
|
|
IXWebinarSeeder,
|
|
TSeederImplementation
|
|
> GetXWebinarMongoRepositoryDescriptor<TSeederImplementation>()
|
|
where TSeederImplementation : XBaseDbSeeder<XWebinar, Guid>
|
|
{
|
|
//
|
|
var result = new XMongoRepositoryDescriptor<
|
|
XWebinar,
|
|
Guid,
|
|
IXWebinarKeyGenerator,
|
|
XWebinarKeyGenerator,
|
|
IXWebinarRepositoryEvents,
|
|
XWebinarRepositoryEvents,
|
|
XWebinarGraphType,
|
|
GuidGraphType,
|
|
XWebinarGraphQuery,
|
|
IXWebinarGraphQLTypeHelper,
|
|
XWebinarGraphQLTypeHelper,
|
|
XWebinarGraphSchema,
|
|
IXWebinarRepository,
|
|
XWebinarMongoRepository,
|
|
IXWebinarSeeder,
|
|
TSeederImplementation
|
|
>();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
//
|
|
#region InMemory Repository Descriptor Provider(s) ...
|
|
public static XInMemoryRepositoryDescriptor<
|
|
XWebinar,
|
|
Guid,
|
|
IXWebinarKeyGenerator,
|
|
XWebinarKeyGenerator,
|
|
IXWebinarRepositoryEvents,
|
|
XWebinarRepositoryEvents,
|
|
XWebinarGraphType,
|
|
GuidGraphType,
|
|
XWebinarGraphQuery,
|
|
IXWebinarGraphQLTypeHelper,
|
|
XWebinarGraphQLTypeHelper,
|
|
XWebinarGraphSchema,
|
|
IXWebinarRepository,
|
|
XWebinarInMemoryRepository
|
|
> GetXWebinarInMemoryRepositoryDescriptor()
|
|
{
|
|
//
|
|
var result = new XInMemoryRepositoryDescriptor<
|
|
XWebinar,
|
|
Guid,
|
|
IXWebinarKeyGenerator,
|
|
XWebinarKeyGenerator,
|
|
IXWebinarRepositoryEvents,
|
|
XWebinarRepositoryEvents,
|
|
XWebinarGraphType,
|
|
GuidGraphType,
|
|
XWebinarGraphQuery,
|
|
IXWebinarGraphQLTypeHelper,
|
|
XWebinarGraphQLTypeHelper,
|
|
XWebinarGraphSchema,
|
|
IXWebinarRepository,
|
|
XWebinarInMemoryRepository
|
|
>();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
public static XInMemoryRepositoryDescriptor<
|
|
XWebinar,
|
|
Guid,
|
|
IXWebinarKeyGenerator,
|
|
XWebinarKeyGenerator,
|
|
IXWebinarRepositoryEvents,
|
|
XWebinarRepositoryEvents,
|
|
XWebinarGraphType,
|
|
GuidGraphType,
|
|
XWebinarGraphQuery,
|
|
IXWebinarGraphQLTypeHelper,
|
|
XWebinarGraphQLTypeHelper,
|
|
XWebinarGraphSchema,
|
|
IXWebinarRepository,
|
|
XWebinarInMemoryRepository,
|
|
IXWebinarSeeder,
|
|
TSeederImplementation
|
|
> GetXWebinarInMemoryRepositoryDescriptor<TSeederImplementation>()
|
|
where TSeederImplementation : XBaseDbSeeder<XWebinar, Guid>
|
|
{
|
|
//
|
|
var result = new XInMemoryRepositoryDescriptor<
|
|
XWebinar,
|
|
Guid,
|
|
IXWebinarKeyGenerator,
|
|
XWebinarKeyGenerator,
|
|
IXWebinarRepositoryEvents,
|
|
XWebinarRepositoryEvents,
|
|
XWebinarGraphType,
|
|
GuidGraphType,
|
|
XWebinarGraphQuery,
|
|
IXWebinarGraphQLTypeHelper,
|
|
XWebinarGraphQLTypeHelper,
|
|
XWebinarGraphSchema,
|
|
IXWebinarRepository,
|
|
XWebinarInMemoryRepository,
|
|
IXWebinarSeeder,
|
|
TSeederImplementation
|
|
>();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
#endregion
|
|
#endregion
|
|
|
|
//
|
|
#region XWebinarSubscriber ...
|
|
//
|
|
#region EF Repository Descriptor Provider(s) ...
|
|
public static XEFRepositoryDescriptor<
|
|
XWebinarSubscriber,
|
|
int,
|
|
IXWebinarSubscriberKeyGenerator,
|
|
XWebinarSubscriberKeyGenerator,
|
|
IXWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberGraphType,
|
|
IntGraphType,
|
|
XWebinarSubscriberGraphQuery,
|
|
IXWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphSchema,
|
|
IXWebinarSubscriberRepository,
|
|
XWebinarSubscriberEFRepository<TContext>,
|
|
TContext
|
|
> GetXWebinarSubscriberEFRepositoryDescriptor<TContext>()
|
|
where TContext : XDbContext
|
|
{
|
|
//
|
|
var result = new XEFRepositoryDescriptor<
|
|
XWebinarSubscriber,
|
|
int,
|
|
IXWebinarSubscriberKeyGenerator,
|
|
XWebinarSubscriberKeyGenerator,
|
|
IXWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberGraphType,
|
|
IntGraphType,
|
|
XWebinarSubscriberGraphQuery,
|
|
IXWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphSchema,
|
|
IXWebinarSubscriberRepository,
|
|
XWebinarSubscriberEFRepository<TContext>,
|
|
TContext
|
|
>();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
public static XEFRepositoryDescriptor<
|
|
XWebinarSubscriber,
|
|
int,
|
|
IXWebinarSubscriberKeyGenerator,
|
|
XWebinarSubscriberKeyGenerator,
|
|
IXWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberGraphType,
|
|
IntGraphType,
|
|
XWebinarSubscriberGraphQuery,
|
|
IXWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphSchema,
|
|
IXWebinarSubscriberRepository,
|
|
XWebinarSubscriberEFRepository<TContext>,
|
|
TContext,
|
|
IXWebinarSubscriberSeeder,
|
|
TSeederImplementation
|
|
> GetXWebinarSubscriberEFRepositoryDescriptor<TContext, TSeederImplementation>()
|
|
where TContext : XDbContext
|
|
where TSeederImplementation : XBaseDbSeeder<XWebinarSubscriber, int>
|
|
{
|
|
//
|
|
var result = new XEFRepositoryDescriptor<
|
|
XWebinarSubscriber,
|
|
int,
|
|
IXWebinarSubscriberKeyGenerator,
|
|
XWebinarSubscriberKeyGenerator,
|
|
IXWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberGraphType,
|
|
IntGraphType,
|
|
XWebinarSubscriberGraphQuery,
|
|
IXWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphSchema,
|
|
IXWebinarSubscriberRepository,
|
|
XWebinarSubscriberEFRepository<TContext>,
|
|
TContext,
|
|
IXWebinarSubscriberSeeder,
|
|
TSeederImplementation
|
|
>();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
//
|
|
#region Mongo Repository Descriptor Provider(s) ...
|
|
public static XMongoRepositoryDescriptor<
|
|
XWebinarSubscriber,
|
|
int,
|
|
IXWebinarSubscriberKeyGenerator,
|
|
XWebinarSubscriberKeyGenerator,
|
|
IXWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberGraphType,
|
|
IntGraphType,
|
|
XWebinarSubscriberGraphQuery,
|
|
IXWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphSchema,
|
|
IXWebinarSubscriberRepository,
|
|
XWebinarSubscriberMongoRepository
|
|
> GetXWebinarSubscriberMongoRepositoryDescriptor()
|
|
{
|
|
//
|
|
var result = new XMongoRepositoryDescriptor<
|
|
XWebinarSubscriber,
|
|
int,
|
|
IXWebinarSubscriberKeyGenerator,
|
|
XWebinarSubscriberKeyGenerator,
|
|
IXWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberGraphType,
|
|
IntGraphType,
|
|
XWebinarSubscriberGraphQuery,
|
|
IXWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphSchema,
|
|
IXWebinarSubscriberRepository,
|
|
XWebinarSubscriberMongoRepository
|
|
>();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
public static XMongoRepositoryDescriptor<
|
|
XWebinarSubscriber,
|
|
int,
|
|
IXWebinarSubscriberKeyGenerator,
|
|
XWebinarSubscriberKeyGenerator,
|
|
IXWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberGraphType,
|
|
IntGraphType,
|
|
XWebinarSubscriberGraphQuery,
|
|
IXWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphSchema,
|
|
IXWebinarSubscriberRepository,
|
|
XWebinarSubscriberMongoRepository,
|
|
IXWebinarSubscriberSeeder,
|
|
TSeederImplementation
|
|
> GetXWebinarSubscriberMongoRepositoryDescriptor<TSeederImplementation>()
|
|
where TSeederImplementation : XBaseDbSeeder<XWebinarSubscriber, int>
|
|
{
|
|
//
|
|
var result = new XMongoRepositoryDescriptor<
|
|
XWebinarSubscriber,
|
|
int,
|
|
IXWebinarSubscriberKeyGenerator,
|
|
XWebinarSubscriberKeyGenerator,
|
|
IXWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberGraphType,
|
|
IntGraphType,
|
|
XWebinarSubscriberGraphQuery,
|
|
IXWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphSchema,
|
|
IXWebinarSubscriberRepository,
|
|
XWebinarSubscriberMongoRepository,
|
|
IXWebinarSubscriberSeeder,
|
|
TSeederImplementation
|
|
>();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
#endregion
|
|
|
|
//
|
|
#region InMemory Repository Descriptor Provider(s) ...
|
|
public static XInMemoryRepositoryDescriptor<
|
|
XWebinarSubscriber,
|
|
int,
|
|
IXWebinarSubscriberKeyGenerator,
|
|
XWebinarSubscriberKeyGenerator,
|
|
IXWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberGraphType,
|
|
IntGraphType,
|
|
XWebinarSubscriberGraphQuery,
|
|
IXWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphSchema,
|
|
IXWebinarSubscriberRepository,
|
|
XWebinarSubscriberInMemoryRepository
|
|
> GetXWebinarSubscriberInMemoryRepositoryDescriptor()
|
|
{
|
|
//
|
|
var result = new XInMemoryRepositoryDescriptor<
|
|
XWebinarSubscriber,
|
|
int,
|
|
IXWebinarSubscriberKeyGenerator,
|
|
XWebinarSubscriberKeyGenerator,
|
|
IXWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberGraphType,
|
|
IntGraphType,
|
|
XWebinarSubscriberGraphQuery,
|
|
IXWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphSchema,
|
|
IXWebinarSubscriberRepository,
|
|
XWebinarSubscriberInMemoryRepository
|
|
>();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
public static XInMemoryRepositoryDescriptor<
|
|
XWebinarSubscriber,
|
|
int,
|
|
IXWebinarSubscriberKeyGenerator,
|
|
XWebinarSubscriberKeyGenerator,
|
|
IXWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberGraphType,
|
|
IntGraphType,
|
|
XWebinarSubscriberGraphQuery,
|
|
IXWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphSchema,
|
|
IXWebinarSubscriberRepository,
|
|
XWebinarSubscriberInMemoryRepository,
|
|
IXWebinarSubscriberSeeder,
|
|
TSeederImplementation
|
|
> GetXWebinarSubscriberInMemoryRepositoryDescriptor<TSeederImplementation>()
|
|
where TSeederImplementation : XBaseDbSeeder<XWebinarSubscriber, int>
|
|
{
|
|
//
|
|
var result = new XInMemoryRepositoryDescriptor<
|
|
XWebinarSubscriber,
|
|
int,
|
|
IXWebinarSubscriberKeyGenerator,
|
|
XWebinarSubscriberKeyGenerator,
|
|
IXWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberRepositoryEvents,
|
|
XWebinarSubscriberGraphType,
|
|
IntGraphType,
|
|
XWebinarSubscriberGraphQuery,
|
|
IXWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphQLTypeHelper,
|
|
XWebinarSubscriberGraphSchema,
|
|
IXWebinarSubscriberRepository,
|
|
XWebinarSubscriberInMemoryRepository,
|
|
IXWebinarSubscriberSeeder,
|
|
TSeederImplementation
|
|
>();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
#endregion
|
|
#endregion
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Interfaces\Dtos\IXWebinarDtoHub.cs
|
|
|
|
using System;
|
|
using xPushService.Interfaces;
|
|
using xWebinarService.Models.Dtos;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Interfaces.Dtos
|
|
{
|
|
public interface IXWebinarDtoHub : IXBaseDtoHub<XWebinar, XWebinarDto, Guid>
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Interfaces\Dtos\IXWebinarRepositoryService.cs
|
|
|
|
using System;
|
|
using xDataService.Interfaces;
|
|
using xWebinarService.Models.Dtos;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Interfaces.Dtos
|
|
{
|
|
public interface IXWebinarRepositoryService : IXBaseRepositoryService<XWebinar, XWebinarDto, Guid>
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Interfaces\Dtos\IXWebinarServiceProvider.cs
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using xPushService.Interfaces;
|
|
using xWebinarService.Models.Dtos;
|
|
using xWebinarService.Models.Entities;
|
|
using xWebinarService.Providers.Dtos;
|
|
|
|
namespace xWebinarService.Interfaces.Dtos
|
|
{
|
|
public interface IXWebinarServiceProvider : IXBaseDtoProvider<XWebinar, XWebinarDto, Guid, XWebinarDtoHub>
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Interfaces\Dtos\IXWebinarSubscriberDtoHub.cs
|
|
|
|
using xPushService.Interfaces;
|
|
using xWebinarService.Models.Dtos;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Interfaces.Dtos
|
|
{
|
|
public interface IXWebinarSubscriberDtoHub : IXBaseDtoHub<XWebinarSubscriber, XWebinarSubscriberDto, int>
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Interfaces\Dtos\IXWebinarSubscriberRepositoryService.cs
|
|
|
|
using xDataService.Interfaces;
|
|
using xWebinarService.Models.Dtos;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Interfaces.Dtos
|
|
{
|
|
public interface IXWebinarSubscriberRepositoryService : IXBaseRepositoryService<XWebinarSubscriber, XWebinarSubscriberDto, int>
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Interfaces\Dtos\IXWebinarSubscriberServiceProvider.cs
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace xWebinarService.Interfaces.Dtos
|
|
{
|
|
public interface IXWebinarSubscriberServiceProvider
|
|
{
|
|
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Interfaces\Entities\IXWebinarEntityHub.cs
|
|
|
|
using System;
|
|
using xPushService.Interfaces;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Interfaces.Entities
|
|
{
|
|
public interface IXWebinarEntityHub : IXBaseEntityHub<XWebinar, Guid>
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Interfaces\Entities\IXWebinarGraphQLTypeHelper.cs
|
|
|
|
using System;
|
|
using xDataService.Interfaces;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Interfaces.Entities
|
|
{
|
|
public interface IXWebinarGraphQLTypeHelper : IXBaseGraphQLTypeHelper<XWebinar, Guid>
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Interfaces\Entities\IXWebinarKeyGenerator.cs
|
|
|
|
using System;
|
|
using xDataService.Interfaces;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Interfaces.Entities
|
|
{
|
|
public interface IXWebinarKeyGenerator : IXKeyGenerator<XWebinar, Guid>
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Interfaces\Entities\IXWebinarRepository.cs
|
|
|
|
using System;
|
|
using xDataService.Interfaces;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Interfaces.Entities
|
|
{
|
|
public interface IXWebinarRepository : IXBaseRepository<XWebinar, Guid>
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Interfaces\Entities\IXWebinarRepositoryEvents.cs
|
|
|
|
using xDataService.Interfaces;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Interfaces.Entities
|
|
{
|
|
public interface IXWebinarRepositoryEvents : IXBaseRepositoryEvents<XWebinar>
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Interfaces\Entities\IXWebinarRepositoryProvider.cs
|
|
|
|
using System;
|
|
using xPushService.Interfaces;
|
|
using xWebinarService.Models.Entities;
|
|
using xWebinarService.Providers.Entities;
|
|
|
|
namespace xWebinarService.Interfaces.Entities
|
|
{
|
|
public interface IXWebinarRepositoryProvider : IXBaseEntityProvider<XWebinar, Guid, XWebinarEntityHub>
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Interfaces\Entities\IXWebinarSeeder.cs
|
|
|
|
using System;
|
|
using xDataService.Interfaces;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Interfaces.Entities
|
|
{
|
|
public interface IXWebinarSeeder : IXBaseDbSeeder<XWebinar, Guid>
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Interfaces\Entities\IXWebinarSubscriberEntityHub.cs
|
|
|
|
using xPushService.Interfaces;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Interfaces.Entities
|
|
{
|
|
public interface IXWebinarSubscriberEntityHub : IXBaseEntityHub<XWebinarSubscriber, int>
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Interfaces\Entities\IXWebinarSubscriberGraphQLTypeHelper.cs
|
|
|
|
using xDataService.Interfaces;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Interfaces.Entities
|
|
{
|
|
public interface IXWebinarSubscriberGraphQLTypeHelper : IXBaseGraphQLTypeHelper<XWebinarSubscriber, int>
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Interfaces\Entities\IXWebinarSubscriberKeyGenerator.cs
|
|
|
|
using xDataService.Interfaces;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Interfaces.Entities
|
|
{
|
|
public interface IXWebinarSubscriberKeyGenerator : IXKeyGenerator<XWebinarSubscriber, int>
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Interfaces\Entities\IXWebinarSubscriberRepository.cs
|
|
|
|
using xDataService.Interfaces;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Interfaces.Entities
|
|
{
|
|
public interface IXWebinarSubscriberRepository : IXBaseRepository<XWebinarSubscriber, int>
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Interfaces\Entities\IXWebinarSubscriberRepositoryEvents.cs
|
|
|
|
using xDataService.Interfaces;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Interfaces.Entities
|
|
{
|
|
public interface IXWebinarSubscriberRepositoryEvents : IXBaseRepositoryEvents<XWebinarSubscriber>
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Interfaces\Entities\IXWebinarSubscriberRepositoryProvider.cs
|
|
|
|
using xPushService.Interfaces;
|
|
using xWebinarService.Models.Entities;
|
|
using xWebinarService.Providers.Entities;
|
|
|
|
namespace xWebinarService.Interfaces.Entities
|
|
{
|
|
public interface IXWebinarSubscriberRepositoryProvider : IXBaseEntityProvider<XWebinarSubscriber, int, XWebinarSubscriberEntityHub>
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Interfaces\Entities\IXWebinarSubscriberSeeder.cs
|
|
|
|
using xDataService.Interfaces;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Interfaces.Entities
|
|
{
|
|
public interface IXWebinarSubscriberSeeder : IXBaseDbSeeder<XWebinarSubscriber, int>
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Models\Dtos\XWebinarDto.cs
|
|
|
|
using System;
|
|
using xModels.Base;
|
|
using xModels.Dtos;
|
|
using xWebinarService.Constants;
|
|
|
|
namespace xWebinarService.Models.Dtos
|
|
{
|
|
public class XWebinarDto : XBaseGuidIDEntityDto
|
|
{
|
|
public bool Enabled { get; set; }
|
|
public string OwnerId { get; set; }
|
|
public XPersonDto Owner { get; set; }
|
|
public XWebinarType Type { get; set; }
|
|
public XResourceDto Title { get; set; }
|
|
public DateTime CreatedOn { get; set; }
|
|
public XResourceDto Description { get; set; }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Models\Dtos\XWebinarSubscriberDto.cs
|
|
|
|
using System;
|
|
using xModels.Base;
|
|
using xModels.Dtos;
|
|
|
|
namespace xWebinarService.Models.Dtos
|
|
{
|
|
public class XWebinarSubscriberDto : XBaseIntIDEntityDto
|
|
{
|
|
public Guid WebinarId { get; set; }
|
|
public string SubscriberId { get; set; }
|
|
public XPersonDto Subscriber { get; set; }
|
|
public DateTime SubscribedOn { get; set; }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Models\Entities\XWebinar.cs
|
|
|
|
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using xModels.Base;
|
|
using xWebinarService.Constants;
|
|
|
|
namespace xWebinarService.Models.Entities
|
|
{
|
|
/// <summary>
|
|
/// Webinar Entity ...
|
|
/// </summary>
|
|
public class XWebinar : XBaseGuidIDEntity
|
|
{
|
|
/// <summary>
|
|
/// Title (Resource ID) ...
|
|
/// </summary>
|
|
/// <value></value>
|
|
[Required]
|
|
[StringLength(255)]
|
|
public string Title { get; set; }
|
|
|
|
/// <summary>
|
|
/// Description (Resource ID) ...
|
|
/// </summary>
|
|
/// <value></value>
|
|
[Required]
|
|
[StringLength(255)]
|
|
public string Description { get; set; }
|
|
|
|
/// <summary>
|
|
/// User Identifier ...
|
|
/// </summary>
|
|
/// <value></value>
|
|
[Required]
|
|
public string OwnerId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Webinar Type ...
|
|
/// </summary>
|
|
public XWebinarType Type { get; set; }
|
|
|
|
/// <summary>
|
|
/// Creation Time ...
|
|
/// </summary>
|
|
/// <value></value>
|
|
[Required]
|
|
public DateTime CreatedOn { get; set; }
|
|
|
|
/// <summary>
|
|
/// Specified Webinar Enabled or not ...
|
|
/// </summary>
|
|
/// <value></value>
|
|
public bool Enabled { get; set; }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Models\Entities\XWebinarSubscriber.cs
|
|
|
|
using System;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using xModels.Base;
|
|
|
|
namespace xWebinarService.Models.Entities
|
|
{
|
|
/// <summary>
|
|
/// Webinar Subscriber ...
|
|
/// </summary>
|
|
public class XWebinarSubscriber : XBaseIntIDEntity
|
|
{
|
|
[Required]
|
|
public string SubscriberId { get; set; }
|
|
|
|
[Required]
|
|
public Guid WebinarId { get; set; }
|
|
|
|
public DateTime SubscribedOn { get; set; }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\XWebinarEntityRegisterar.cs
|
|
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using xDataService.Interfaces;
|
|
using xDataService.Providers;
|
|
using xWebinarService.Configurations.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers
|
|
{
|
|
public class XWebinarEntityRegisterar : XBaseEntityRegisterar, IXEntityRegisterar
|
|
{
|
|
public XWebinarEntityRegisterar()
|
|
: base(nameof(XWebinarEntityRegisterar))
|
|
{
|
|
//
|
|
// Add Entity ...
|
|
AddEntity<XWebinar, Guid>();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Configure Entities ...
|
|
/// </summary>
|
|
/// <param name="modelBuilder"></param>
|
|
public override void ConfigureEntities(ModelBuilder modelBuilder)
|
|
{
|
|
//
|
|
// Configure Entity Using Provided ...
|
|
modelBuilder
|
|
.ApplyConfigurationsFromAssembly(typeof(XWebinarEntityConfiguration).Assembly);
|
|
|
|
//
|
|
base.ConfigureEntities(modelBuilder);
|
|
}
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\XWebinarSubscriberEntityRegisterar.cs
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
using xDataService.Interfaces;
|
|
using xDataService.Providers;
|
|
using xWebinarService.Configurations.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers
|
|
{
|
|
public class XWebinarSubscriberEntityRegisterar : XBaseEntityRegisterar, IXEntityRegisterar
|
|
{
|
|
public XWebinarSubscriberEntityRegisterar()
|
|
: base(nameof(XWebinarSubscriberEntityRegisterar))
|
|
{
|
|
//
|
|
// Add Entity ...
|
|
AddEntity<XWebinarSubscriber, int>();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Configure Entities ...
|
|
/// </summary>
|
|
/// <param name="modelBuilder"></param>
|
|
public override void ConfigureEntities(ModelBuilder modelBuilder)
|
|
{
|
|
//
|
|
// Configure Entity Using Provided ...
|
|
modelBuilder
|
|
.ApplyConfigurationsFromAssembly(typeof(XWebinarSubscriberEntityConfiguration).Assembly);
|
|
|
|
//
|
|
base.ConfigureEntities(modelBuilder);
|
|
}
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Dtos\XWebinarDtoHub.cs
|
|
|
|
using System;
|
|
using Microsoft.Extensions.Logging;
|
|
using xPushService.Base;
|
|
using xWebinarService.Interfaces.Dtos;
|
|
using xWebinarService.Models.Dtos;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Dtos
|
|
{
|
|
public class XWebinarDtoHub : XBaseDtoHub<XWebinar, XWebinarDto, Guid>, IXWebinarDtoHub
|
|
{
|
|
public XWebinarDtoHub(
|
|
ILogger<XWebinarDtoHub> logger
|
|
) : base(logger)
|
|
{ }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Dtos\XWebinarRepositoryService.cs
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using AutoMapper;
|
|
using xDataService.Providers;
|
|
using xWebinarService.Interfaces.Dtos;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Dtos;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Dtos
|
|
{
|
|
public class XWebinarRepositoryService : XBaseRepositoryService<XWebinar, XWebinarDto, Guid>, IXWebinarRepositoryService
|
|
{
|
|
public XWebinarRepositoryService(
|
|
IXWebinarRepository repository,
|
|
IEnumerable<Profile> mapperProfiles = null
|
|
) : base(
|
|
repository,
|
|
mapperProfiles
|
|
)
|
|
{ }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Dtos\XWebinarServiceProvider.cs
|
|
|
|
using System;
|
|
using Microsoft.AspNetCore.SignalR;
|
|
using xDataService.Configuration;
|
|
using xIdentityService.Interfaces;
|
|
using xPushService.Base;
|
|
using xWebinarService.Interfaces.Dtos;
|
|
using xWebinarService.Models.Dtos;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Dtos
|
|
{
|
|
public class XWebinarServiceProvider : XBaseDtoProvider<XWebinar, XWebinarDto, Guid, XWebinarDtoHub>, IXWebinarServiceProvider
|
|
{
|
|
public XWebinarServiceProvider(
|
|
IHubContext<XWebinarDtoHub> hub,
|
|
XDataServiceConfiguration dataConfiguration,
|
|
IXWebinarRepositoryService service,
|
|
IXIdentityProvider identityProvider = null
|
|
) : base(
|
|
hub,
|
|
dataConfiguration,
|
|
service,
|
|
identityProvider
|
|
)
|
|
{ }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Dtos\XWebinarSubscriberDtoHub.cs
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
using xPushService.Base;
|
|
using xWebinarService.Interfaces.Dtos;
|
|
using xWebinarService.Models.Dtos;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Dtos
|
|
{
|
|
public class XWebinarSubscriberDtoHub : XBaseDtoHub<XWebinarSubscriber, XWebinarSubscriberDto, int>, IXWebinarSubscriberDtoHub
|
|
{
|
|
public XWebinarSubscriberDtoHub(
|
|
ILogger<XWebinarSubscriberDtoHub> logger
|
|
) : base(logger)
|
|
{ }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Dtos\XWebinarSubscriberRepositoryService.cs
|
|
|
|
using System.Collections.Generic;
|
|
using AutoMapper;
|
|
using xDataService.Providers;
|
|
using xWebinarService.Interfaces.Dtos;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Dtos;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Dtos
|
|
{
|
|
public class XWebinarSubscriberRepositoryService : XBaseRepositoryService<XWebinarSubscriber, XWebinarSubscriberDto, int>, IXWebinarSubscriberRepositoryService
|
|
{
|
|
public XWebinarSubscriberRepositoryService(
|
|
IXWebinarSubscriberRepository repository,
|
|
IEnumerable<Profile> mapperProfiles = null
|
|
) : base(
|
|
repository,
|
|
mapperProfiles
|
|
)
|
|
{ }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Dtos\XWebinarSubscriberServiceProvider.cs
|
|
|
|
using Microsoft.AspNetCore.SignalR;
|
|
using xDataService.Configuration;
|
|
using xIdentityService.Interfaces;
|
|
using xPushService.Base;
|
|
using xWebinarService.Interfaces.Dtos;
|
|
using xWebinarService.Models.Dtos;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Dtos
|
|
{
|
|
public class XWebinarSubscriberServiceProvider : XBaseDtoProvider<XWebinarSubscriber, XWebinarSubscriberDto, int, XWebinarSubscriberDtoHub>, IXWebinarSubscriberServiceProvider
|
|
{
|
|
public XWebinarSubscriberServiceProvider(
|
|
IHubContext<XWebinarSubscriberDtoHub> hub,
|
|
XDataServiceConfiguration dataConfiguration,
|
|
IXWebinarSubscriberRepositoryService service,
|
|
IXIdentityProvider identityProvider = null
|
|
) : base(
|
|
hub,
|
|
dataConfiguration,
|
|
service,
|
|
identityProvider
|
|
)
|
|
{ }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Entities\XWebinarEFRepository.cs
|
|
|
|
using System;
|
|
using xDataService.Configuration;
|
|
using xDataService.Db;
|
|
using xDataService.Interfaces;
|
|
using xDataService.Providers;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Entities
|
|
{
|
|
public class XWebinarEFRepository<TContext> : XBaseEFRepository<XWebinar, Guid, TContext>, IXWebinarRepository
|
|
where TContext : XDbContext
|
|
{
|
|
public XWebinarEFRepository(
|
|
IXUnitOfWorks<TContext> unitOfWorks,
|
|
XDataServiceConfiguration configuration,
|
|
IXWebinarKeyGenerator keyGenerator = null,
|
|
IXWebinarRepositoryEvents baseRepositoryEvents = null
|
|
) : base(
|
|
unitOfWorks,
|
|
configuration,
|
|
keyGenerator,
|
|
baseRepositoryEvents
|
|
)
|
|
{ }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Entities\XWebinarEntityHub.cs
|
|
|
|
using System;
|
|
using Microsoft.Extensions.Logging;
|
|
using xPushService.Base;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Entities
|
|
{
|
|
public class XWebinarEntityHub : XBaseEntityHub<XWebinar, Guid>, IXWebinarEntityHub
|
|
{
|
|
public XWebinarEntityHub(
|
|
ILogger<XWebinarEntityHub> logger
|
|
) : base(logger)
|
|
{ }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Entities\XWebinarInMemoryRepository.cs
|
|
|
|
using System;
|
|
using xDataService.Configuration;
|
|
using xDataService.Providers;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Entities
|
|
{
|
|
public class XWebinarInMemoryRepository : XBaseInMemoryRepository<XWebinar, Guid>, IXWebinarRepository
|
|
{
|
|
public XWebinarInMemoryRepository(
|
|
XDataServiceConfiguration configuration,
|
|
IXWebinarKeyGenerator keyGenerator = null,
|
|
IXWebinarRepositoryEvents baseRepositoryEvents = null
|
|
) : base(
|
|
configuration,
|
|
keyGenerator,
|
|
baseRepositoryEvents
|
|
)
|
|
{ }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Entities\XWebinarKeyGenerator.cs
|
|
|
|
using xDataService.Providers;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Entities
|
|
{
|
|
public class XWebinarKeyGenerator : XGuidKeyGenerator<XWebinar>, IXWebinarKeyGenerator
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Entities\XWebinarMongoRepository.cs
|
|
|
|
using System;
|
|
using xDataService.Configuration;
|
|
using xDataService.Providers;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Entities
|
|
{
|
|
public class XWebinarMongoRepository : XBaseMongoRepository<XWebinar, Guid>, IXWebinarRepository
|
|
{
|
|
public XWebinarMongoRepository(
|
|
XDataBaseConfiguration dbConfiguration,
|
|
XDataServiceConfiguration configuration,
|
|
string collectionName = null,
|
|
IXWebinarKeyGenerator keyGenerator = null,
|
|
IXWebinarRepositoryEvents baseRepositoryEvents = null
|
|
) : base(
|
|
dbConfiguration,
|
|
configuration,
|
|
collectionName,
|
|
keyGenerator,
|
|
baseRepositoryEvents
|
|
)
|
|
{ }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Entities\XWebinarRepositoryEvents.cs
|
|
|
|
using xDataService.Providers;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Entities
|
|
{
|
|
public class XWebinarRepositoryEvents : XBaseRepositoryEvents<XWebinar>, IXWebinarRepositoryEvents
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Entities\XWebinarRepositoryProvider.cs
|
|
|
|
using System;
|
|
using Microsoft.AspNetCore.SignalR;
|
|
using xDataService.Configuration;
|
|
using xIdentityService.Interfaces;
|
|
using xPushService.Base;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Entities
|
|
{
|
|
public class XWebinarRepositoryProvider : XBaseEntityProvider<XWebinar, Guid, XWebinarEntityHub>, IXWebinarRepositoryProvider
|
|
{
|
|
public XWebinarRepositoryProvider(
|
|
IHubContext<XWebinarEntityHub> hub,
|
|
IXWebinarRepository repository,
|
|
XDataServiceConfiguration dataConfiguration,
|
|
IXIdentityProvider identityProvider = null
|
|
) : base(
|
|
hub,
|
|
repository,
|
|
dataConfiguration,
|
|
identityProvider
|
|
)
|
|
{ }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Entities\XWebinarSeederBase.cs
|
|
|
|
using System;
|
|
using xDataService.Configuration;
|
|
using xDataService.Providers;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Entities
|
|
{
|
|
public abstract class XWebinarSeederBase : XBaseDbSeeder<XWebinar, Guid>, IXWebinarSeeder
|
|
{
|
|
public XWebinarSeederBase(
|
|
string entity,
|
|
string database,
|
|
IXWebinarRepository repository,
|
|
XDataServiceConfiguration dataServiceConfiguration
|
|
) : base(
|
|
entity,
|
|
database,
|
|
repository,
|
|
dataServiceConfiguration
|
|
)
|
|
{ }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Entities\XWebinarSubscriberEFRepository.cs
|
|
|
|
using xDataService.Configuration;
|
|
using xDataService.Db;
|
|
using xDataService.Interfaces;
|
|
using xDataService.Providers;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Entities
|
|
{
|
|
public class XWebinarSubscriberEFRepository<TContext> : XBaseEFRepository<XWebinarSubscriber, int, TContext>, IXWebinarSubscriberRepository
|
|
where TContext : XDbContext
|
|
{
|
|
public XWebinarSubscriberEFRepository(
|
|
IXUnitOfWorks<TContext> unitOfWorks,
|
|
XDataServiceConfiguration configuration,
|
|
IXWebinarSubscriberKeyGenerator keyGenerator = null,
|
|
IXWebinarSubscriberRepositoryEvents baseRepositoryEvents = null
|
|
) : base(
|
|
unitOfWorks,
|
|
configuration,
|
|
keyGenerator,
|
|
baseRepositoryEvents
|
|
)
|
|
{ }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Entities\XWebinarSubscriberEntityHub.cs
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
using xPushService.Base;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Entities
|
|
{
|
|
public class XWebinarSubscriberEntityHub : XBaseEntityHub<XWebinarSubscriber, int>, IXWebinarSubscriberEntityHub
|
|
{
|
|
public XWebinarSubscriberEntityHub(
|
|
ILogger<XWebinarSubscriberEntityHub> logger
|
|
) : base(logger)
|
|
{ }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Entities\XWebinarSubscriberInMemoryRepository.cs
|
|
|
|
using xDataService.Configuration;
|
|
using xDataService.Providers;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Entities
|
|
{
|
|
public class XWebinarSubscriberInMemoryRepository : XBaseInMemoryRepository<XWebinarSubscriber, int>, IXWebinarSubscriberRepository
|
|
{
|
|
public XWebinarSubscriberInMemoryRepository(
|
|
XDataServiceConfiguration configuration,
|
|
IXWebinarSubscriberKeyGenerator keyGenerator = null,
|
|
IXWebinarSubscriberRepositoryEvents baseRepositoryEvents = null
|
|
) : base(
|
|
configuration,
|
|
keyGenerator,
|
|
baseRepositoryEvents
|
|
)
|
|
{ }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Entities\XWebinarSubscriberKeyGenerator.cs
|
|
|
|
using xDataService.Providers;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Entities
|
|
{
|
|
public class XWebinarSubscriberKeyGenerator : XIntKeyGenerator<XWebinarSubscriber>, IXWebinarSubscriberKeyGenerator
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Entities\XWebinarSubscriberMongoRepository.cs
|
|
|
|
using xDataService.Configuration;
|
|
using xDataService.Providers;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Entities
|
|
{
|
|
public class XWebinarSubscriberMongoRepository : XBaseMongoRepository<XWebinarSubscriber, int>, IXWebinarSubscriberRepository
|
|
{
|
|
public XWebinarSubscriberMongoRepository(
|
|
XDataBaseConfiguration dbConfiguration,
|
|
XDataServiceConfiguration configuration,
|
|
string collectionName = null,
|
|
IXWebinarSubscriberKeyGenerator keyGenerator = null,
|
|
IXWebinarSubscriberRepositoryEvents baseRepositoryEvents = null
|
|
) : base(
|
|
dbConfiguration,
|
|
configuration,
|
|
collectionName,
|
|
keyGenerator,
|
|
baseRepositoryEvents
|
|
)
|
|
{ }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Entities\XWebinarSubscriberRepositoryEvents.cs
|
|
|
|
using xDataService.Providers;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Entities
|
|
{
|
|
public class XWebinarSubscriberRepositoryEvents : XBaseRepositoryEvents<XWebinarSubscriber>, IXWebinarSubscriberRepositoryEvents
|
|
{ }
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Entities\XWebinarSubscriberRepositoryProvider.cs
|
|
|
|
using System;
|
|
using Microsoft.AspNetCore.SignalR;
|
|
using xDataService.Configuration;
|
|
using xIdentityService.Interfaces;
|
|
using xPushService.Base;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Entities
|
|
{
|
|
public class XWebinarSubscriberRepositoryProvider : XBaseEntityProvider<XWebinarSubscriber, int, XWebinarSubscriberEntityHub>, IXWebinarSubscriberRepositoryProvider
|
|
{
|
|
public XWebinarSubscriberRepositoryProvider(
|
|
IHubContext<XWebinarSubscriberEntityHub> hub,
|
|
IXWebinarSubscriberRepository repository,
|
|
XDataServiceConfiguration dataConfiguration,
|
|
IXIdentityProvider identityProvider = null
|
|
) : base(
|
|
hub,
|
|
repository,
|
|
dataConfiguration,
|
|
identityProvider
|
|
)
|
|
{ }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\Entities\XWebinarSubscriberSeederBase.cs
|
|
|
|
using xDataService.Configuration;
|
|
using xDataService.Providers;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.Entities
|
|
{
|
|
public abstract class XWebinarSubscriberSeederBase : XBaseDbSeeder<XWebinarSubscriber, int>, IXWebinarSubscriberSeeder
|
|
{
|
|
public XWebinarSubscriberSeederBase(
|
|
string entity,
|
|
string database,
|
|
IXWebinarSubscriberRepository repository,
|
|
XDataServiceConfiguration dataServiceConfiguration
|
|
) : base(
|
|
entity,
|
|
database,
|
|
repository,
|
|
dataServiceConfiguration
|
|
)
|
|
{ }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\GraphQL\XWebinarGraphQLTypeHelper.cs
|
|
|
|
using System;
|
|
using xDataService.Configuration;
|
|
using xDataService.GraphQL;
|
|
using xWebinarService.Constants;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.GraphQL
|
|
{
|
|
public class XWebinarGraphQLTypeHelper : XBaseGraphQLTypeHelper<XWebinar, Guid>, IXWebinarGraphQLTypeHelper
|
|
{
|
|
public XWebinarGraphQLTypeHelper(
|
|
XDataServiceConfiguration configuration
|
|
) : base(configuration)
|
|
{ }
|
|
|
|
public override string GetInQueryCollectionName()
|
|
{
|
|
return XWebinarServiceConstants.XWebinarCollectionName;
|
|
}
|
|
|
|
public override string GetInQuerySingleName()
|
|
{
|
|
return XWebinarServiceConstants.XWebinarSingleName;
|
|
}
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\GraphQL\XWebinarGraphQuery.cs
|
|
|
|
using System;
|
|
using GraphQL.Types;
|
|
using xDataService.Configuration;
|
|
using xDataService.GraphQL;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.GraphQL
|
|
{
|
|
public class XWebinarGraphQuery : XBaseGraphQLQuery<XWebinar, Guid, XWebinarGraphType, GuidGraphType>
|
|
{
|
|
public XWebinarGraphQuery(
|
|
XDataServiceConfiguration configuration,
|
|
IXWebinarRepository repository,
|
|
IXWebinarGraphQLTypeHelper helper
|
|
) : base(
|
|
configuration,
|
|
repository,
|
|
helper
|
|
)
|
|
{ }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\GraphQL\XWebinarGraphSchema.cs
|
|
|
|
using System;
|
|
using GraphQL.Types;
|
|
|
|
namespace xWebinarService.Providers.GraphQL
|
|
{
|
|
public class XWebinarGraphSchema : Schema
|
|
{
|
|
public XWebinarGraphSchema(IServiceProvider services) : base(services)
|
|
{
|
|
Query = (XWebinarGraphQuery)services.GetService(typeof(XWebinarGraphQuery));
|
|
}
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\GraphQL\XWebinarGraphType.cs
|
|
|
|
using System;
|
|
using xDataService.GraphQL;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.GraphQL
|
|
{
|
|
public class XWebinarGraphType : XBaseGraphObjectType<XWebinar, Guid>
|
|
{
|
|
public XWebinarGraphType() : base()
|
|
{
|
|
Field(x => x.Type);
|
|
Field(x => x.Title);
|
|
Field(x => x.OwnerId);
|
|
Field(x => x.Enabled);
|
|
Field(x => x.CreatedOn);
|
|
Field(x => x.Description);
|
|
}
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\GraphQL\XWebinarSubscriberGraphQLTypeHelper.cs
|
|
|
|
using System;
|
|
using xDataService.Configuration;
|
|
using xDataService.GraphQL;
|
|
using xWebinarService.Constants;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.GraphQL
|
|
{
|
|
public class XWebinarSubscriberGraphQLTypeHelper : XBaseGraphQLTypeHelper<XWebinarSubscriber, int>, IXWebinarSubscriberGraphQLTypeHelper
|
|
{
|
|
public XWebinarSubscriberGraphQLTypeHelper(
|
|
XDataServiceConfiguration configuration
|
|
) : base(configuration)
|
|
{ }
|
|
|
|
public override string GetInQueryCollectionName()
|
|
{
|
|
return XWebinarServiceConstants.XWebinarSubscriberCollectionName;
|
|
}
|
|
|
|
public override string GetInQuerySingleName()
|
|
{
|
|
return XWebinarServiceConstants.XWebinarSubscriberSingleName;
|
|
}
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\GraphQL\XWebinarSubscriberGraphQuery.cs
|
|
|
|
using GraphQL.Types;
|
|
using xDataService.Configuration;
|
|
using xDataService.GraphQL;
|
|
using xWebinarService.Interfaces.Entities;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.GraphQL
|
|
{
|
|
public class XWebinarSubscriberGraphQuery : XBaseGraphQLQuery<XWebinarSubscriber, int, XWebinarSubscriberGraphType, IntGraphType>
|
|
{
|
|
public XWebinarSubscriberGraphQuery(
|
|
XDataServiceConfiguration configuration,
|
|
IXWebinarSubscriberRepository repository,
|
|
IXWebinarSubscriberGraphQLTypeHelper helper
|
|
) : base(
|
|
configuration,
|
|
repository,
|
|
helper
|
|
)
|
|
{ }
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\GraphQL\XWebinarSubscriberGraphSchema.cs
|
|
|
|
using System;
|
|
using GraphQL.Types;
|
|
|
|
namespace xWebinarService.Providers.GraphQL
|
|
{
|
|
public class XWebinarSubscriberGraphSchema : Schema
|
|
{
|
|
public XWebinarSubscriberGraphSchema(IServiceProvider services) : base(services)
|
|
{
|
|
Query = (XWebinarSubscriberGraphQuery)services.GetService(typeof(XWebinarSubscriberGraphQuery));
|
|
}
|
|
}
|
|
}
|
|
|
|
### FILE: C:\Users\SaherElm\Documents\Projects\xSaherelmWorkspace\Modules\xWebinarService\Providers\GraphQL\XWebinarSubscriberGraphType.cs
|
|
|
|
using xDataService.GraphQL;
|
|
using xWebinarService.Models.Entities;
|
|
|
|
namespace xWebinarService.Providers.GraphQL
|
|
{
|
|
public class XWebinarSubscriberGraphType : XBaseGraphObjectType<XWebinarSubscriber, int>
|
|
{
|
|
public XWebinarSubscriberGraphType() : base()
|
|
{
|
|
Field(x => x.WebinarId);
|
|
Field(x => x.SubscribedOn);
|
|
Field(x => x.SubscriberId);
|
|
}
|
|
}
|
|
}
|