diff --git a/Controllers/XIBaseV1EntityController.cs b/Controllers/XIBaseV1EntityController.cs index ef5c054..106052c 100644 --- a/Controllers/XIBaseV1EntityController.cs +++ b/Controllers/XIBaseV1EntityController.cs @@ -20,119 +20,121 @@ using xPushService.Constants; namespace xIdentityHelper.Controllers { - [ApiController] - [ApiVersion("1.0")] - [RequireXPowered(true)] - [Route("api/v{version:apiVersion}/entities/[controller]")] - public abstract class XIBaseV1EntityController : XIBaseEntityController - where TEntity : XBaseEntity - { - // - #region Constructor ... - protected XIBaseV1EntityController( - ILogger> logger, - XAppConfiguration appConfiguration, - IXIdentityProvider identityProvider, - XValidationProvider validationProvider, - IXBaseRepository repository, - Func, IOrderedQueryable> defaultOrderBuilder = null, - Func, IIncludableQueryable> defaultIncludeBuilder = null - ) : base( - logger: logger, - repository: repository, - appConfiguration: appConfiguration, - identityProvider: identityProvider, - validationProvider: validationProvider, - defaultOrderBuilder: defaultOrderBuilder, - defaultIncludeBuilder: defaultIncludeBuilder - ) - { } - #endregion - } + // + // TODO: Fix this ... + // [ApiController] + // [ApiVersion("1.0")] + // [RequireXPowered(true)] + // [Route("api/v{version:apiVersion}/entities/[controller]")] + // public abstract class XIBaseV1EntityController : XIBaseEntityController + // where TEntity : XBaseEntity + // { + // // + // #region Constructor ... + // protected XIBaseV1EntityController( + // ILogger> logger, + // XAppConfiguration appConfiguration, + // IXIdentityProvider identityProvider, + // XValidationProvider validationProvider, + // IXBaseRepository repository, + // Func, IOrderedQueryable> defaultOrderBuilder = null, + // Func, IIncludableQueryable> defaultIncludeBuilder = null + // ) : base( + // logger: logger, + // repository: repository, + // appConfiguration: appConfiguration, + // identityProvider: identityProvider, + // validationProvider: validationProvider, + // defaultOrderBuilder: defaultOrderBuilder, + // defaultIncludeBuilder: defaultIncludeBuilder + // ) + // { } + // #endregion + // } - public abstract class XIBaseV1EntityHubController : XIBaseV1EntityController - where TEntity : XBaseEntity - { - // - #region Props ... - public IHubContext> Hub { get; } - #endregion + // public abstract class XIBaseV1EntityHubController : XIBaseV1EntityController + // where TEntity : XBaseEntity + // { + // // + // #region Props ... + // public IHubContext> Hub { get; } + // #endregion - // - #region Constructor ... - protected XIBaseV1EntityHubController( - ILogger> logger, - XAppConfiguration appConfiguration, - IXIdentityProvider identityProvider, - XValidationProvider validationProvider, - IXBaseRepository repository, - IHubContext> hub = null, - Func, IOrderedQueryable> defaultOrderBuilder = null, - Func, IIncludableQueryable> defaultIncludeBuilder = null - ) : base( - logger: logger, - repository: repository, - appConfiguration: appConfiguration, - identityProvider: identityProvider, - validationProvider: validationProvider, - defaultOrderBuilder: defaultOrderBuilder, - defaultIncludeBuilder: defaultIncludeBuilder - ) - { - Hub = hub; - } - #endregion + // // + // #region Constructor ... + // protected XIBaseV1EntityHubController( + // ILogger> logger, + // XAppConfiguration appConfiguration, + // IXIdentityProvider identityProvider, + // XValidationProvider validationProvider, + // IXBaseRepository repository, + // IHubContext> hub = null, + // Func, IOrderedQueryable> defaultOrderBuilder = null, + // Func, IIncludableQueryable> defaultIncludeBuilder = null + // ) : base( + // logger: logger, + // repository: repository, + // appConfiguration: appConfiguration, + // identityProvider: identityProvider, + // validationProvider: validationProvider, + // defaultOrderBuilder: defaultOrderBuilder, + // defaultIncludeBuilder: defaultIncludeBuilder + // ) + // { + // Hub = hub; + // } + // #endregion - // - #region Hub ... - [NonAction] - public async Task SendPush( - string action, - string payLoad, - CancellationToken cancellationToken = default - ) - { - // - var actions = new List - { - XBaseEntityHubAction.Add.GetStringValue(), - XBaseEntityHubAction.Update.GetStringValue(), - XBaseEntityHubAction.Delete.GetStringValue(), - XBaseEntityHubAction.AddMany.GetStringValue(), - XBaseEntityHubAction.DeleteMany.GetStringValue(), - XBaseEntityHubAction.UpdateMany.GetStringValue(), - XBaseEntityHubAction.AddOrUpdate.GetStringValue(), - }; + // // + // #region Hub ... + // [NonAction] + // public async Task SendPush( + // string action, + // string payLoad, + // CancellationToken cancellationToken = default + // ) + // { + // // + // var actions = new List + // { + // XBaseEntityHubAction.Add.GetStringValue(), + // XBaseEntityHubAction.Update.GetStringValue(), + // XBaseEntityHubAction.Delete.GetStringValue(), + // XBaseEntityHubAction.AddMany.GetStringValue(), + // XBaseEntityHubAction.DeleteMany.GetStringValue(), + // XBaseEntityHubAction.UpdateMany.GetStringValue(), + // XBaseEntityHubAction.AddOrUpdate.GetStringValue(), + // }; - // - // Validate ... - var isValid = - !Hub.IsNull() && - !action.IsNullOrEmpty() && - !payLoad.IsNullOrEmpty() && - actions.Contains(action); - if (!isValid) - { - return; - } + // // + // // Validate ... + // var isValid = + // !Hub.IsNull() && + // !action.IsNullOrEmpty() && + // !payLoad.IsNullOrEmpty() && + // actions.Contains(action); + // if (!isValid) + // { + // return; + // } - // - // Retrieve Connection Id ... - var connectionId = GetConnectionId(); - var clients = Hub.Clients.All; - if (!connectionId.IsNullOrEmpty()) - { - clients = Hub.Clients.AllExcept(connectionId); - } + // // + // // Retrieve Connection Id ... + // var connectionId = GetConnectionId(); + // var clients = Hub.Clients.All; + // if (!connectionId.IsNullOrEmpty()) + // { + // clients = Hub.Clients.AllExcept(connectionId); + // } - // - await clients.SendAsync( - action, - payLoad, - connectionId, - cancellationToken - ); - } - #endregion - } + // // + // await clients.SendAsync( + // action, + // payLoad, + // connectionId, + // cancellationToken + // ); + // } + // #endregion + // } } \ No newline at end of file