diff --git a/Hub/XWebinarHub.cs b/Hub/XWebinarHub.cs index 7760d7e..202ce85 100644 --- a/Hub/XWebinarHub.cs +++ b/Hub/XWebinarHub.cs @@ -12,7 +12,7 @@ using xPushService.Base; using xPushService.Extensions; using xWebinarService.Constants; using xWebinarService.Models.Dtos; -using xWebinarService.Providers; +using xWebinarService.Interfaces; namespace xWebinarService.Hub { @@ -20,14 +20,14 @@ namespace xWebinarService.Hub { // #region Props ... - public readonly XWebinarProvider webinarProvider; + public readonly IXWebinarProvider webinarProvider; #endregion // #region Constructor ... public XWebinarHub( ILogger logger, - XWebinarProvider webinarProvider + IXWebinarProvider webinarProvider ) : base(logger) { this.webinarProvider = webinarProvider; @@ -260,7 +260,12 @@ namespace xWebinarService.Hub // // Notify Other Users which a Viewer Joined ... - await Clients.OthersInGroup(webinarName).SendAsync(XWebinarHubAction.ViewerJoined.GetStringValue(), connectionId, userInfo.UserId, userInfo.UserName); + await Clients.OthersInGroup(webinarName).SendAsync(XWebinarHubAction.ViewerJoined.GetStringValue(), + connectionId, + webinarId, + userInfo.UserId, + userInfo.UserName + ); } catch { } @@ -339,9 +344,10 @@ namespace xWebinarService.Hub // // Notify Other Users which a Viewer Leaved ... - await Clients.OthersInGroup(webinarName).SendAsync(XWebinarHubAction.ViewerLeaved.GetStringValue(), - connectionId, - userInfo.UserId, + await Clients.OthersInGroup(webinarName).SendAsync(XWebinarHubAction.ViewerLeaved.GetStringValue(), + connectionId, + webinarId, + userInfo.UserId, userInfo.UserName ); } @@ -420,10 +426,10 @@ namespace xWebinarService.Hub // // Notify Other Users which a Viewer Leaved ... - await Clients.OthersInGroup(webinarName).SendAsync(XWebinarHubAction.Message.GetStringValue(), - connectionId, - userInfo.UserId, - userInfo.UserName, + await Clients.OthersInGroup(webinarName).SendAsync(XWebinarHubAction.Message.GetStringValue(), + connectionId, + userInfo.UserId, + userInfo.UserName, message ); } diff --git a/Providers/XWebinarProvider.cs b/Providers/XWebinarProvider.cs index 92f8ebd..09893d0 100644 --- a/Providers/XWebinarProvider.cs +++ b/Providers/XWebinarProvider.cs @@ -84,6 +84,7 @@ namespace xWebinarService.Providers Id = model.Id, Type = model.Type, OwnerId = model.OwnerId, + Enabled = model.Enabled, CreatedOn = model.CreatedOn, // @@ -334,6 +335,15 @@ namespace xWebinarService.Providers entity.Type = item.Type; entity = await WebinarRepository.UpdateAsync(entity.Id, entity); } + + // + // Check if Enabled Change Update it ... + if (entity.Enabled != item.Enabled) + { + // + entity.Enabled = item.Enabled; + entity = await WebinarRepository.UpdateAsync(entity.Id, entity); + } // // Retrieve Entity Dto ...