From 546d72b7884b734e66f75bcf0c657b9ac224063a Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Sun, 16 Nov 2025 20:40:45 +0330 Subject: [PATCH] Add Support for connectionId ... --- Controllers/XWebinarServiceControllerBase.cs | 26 ++++++++++++++++---- Providers/XWebinarProvider.cs | 10 ++++---- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/Controllers/XWebinarServiceControllerBase.cs b/Controllers/XWebinarServiceControllerBase.cs index 7ec168d..b1e1bb7 100644 --- a/Controllers/XWebinarServiceControllerBase.cs +++ b/Controllers/XWebinarServiceControllerBase.cs @@ -65,6 +65,7 @@ namespace xWebinarService.Controllers // // Retrieve User Info ... var userInfo = await GetUserInfo(); + var connectionId = GetConnectionId(); bool isAdmin = userInfo.Roles.Any(r => r.ToNormalString() == "admin"); var userId = userInfo.UserId; @@ -77,7 +78,10 @@ namespace xWebinarService.Controllers // var result = await WebinarProvider - .CreateWebinar(item); + .CreateWebinar( + item: item, + connectionId: connectionId + ); // return Ok(result. @@ -108,6 +112,7 @@ namespace xWebinarService.Controllers // // Retrieve User Info ... var userInfo = await GetUserInfo(); + var connectionId = GetConnectionId(); bool isAdmin = userInfo.Roles.Any(r => r.ToNormalString() == "admin"); var userId = userInfo.UserId; @@ -121,7 +126,10 @@ namespace xWebinarService.Controllers // var result = await WebinarProvider - .UpdateWebinar(item); + .UpdateWebinar( + item: item, + connectionId: connectionId + ); // return Ok(result. @@ -296,6 +304,7 @@ namespace xWebinarService.Controllers // // Retrieve User Info ... var userInfo = await GetUserInfo(); + var connectionId = GetConnectionId(); bool isAdmin = userInfo.Roles.Any(r => r.ToNormalString() == "admin"); var userId = userInfo.UserId; @@ -318,7 +327,10 @@ namespace xWebinarService.Controllers // var result = await WebinarProvider - .RemoveWebinar(webinarId); + .RemoveWebinar( + webinarId: webinarId, + connectionId: connectionId + ); // return Ok(result. @@ -354,6 +366,7 @@ namespace xWebinarService.Controllers // // Retrieve User Info ... var userInfo = await GetUserInfo(); + var connectionId = GetConnectionId(); bool isAdmin = userInfo.Roles.Any(r => r.ToNormalString() == "admin"); var userId = userInfo.UserId; @@ -381,7 +394,8 @@ namespace xWebinarService.Controllers var result = await WebinarProvider .Subscribe( webinarId: webinarId, - subscriberId: subscriberId + subscriberId: subscriberId, + connectionId: connectionId ); // @@ -475,6 +489,7 @@ namespace xWebinarService.Controllers // // Retrieve User Info ... var userInfo = await GetUserInfo(); + var connectionId = GetConnectionId(); bool isAdmin = userInfo.Roles.Any(r => r.ToNormalString() == "admin"); var userId = userInfo.UserId; @@ -502,7 +517,8 @@ namespace xWebinarService.Controllers var result = await WebinarProvider .Unsubscribe( webinarId: webinarId, - subscriberId: subscriberId + subscriberId: subscriberId, + connectionId: connectionId ); // diff --git a/Providers/XWebinarProvider.cs b/Providers/XWebinarProvider.cs index 4927568..02cf3b1 100644 --- a/Providers/XWebinarProvider.cs +++ b/Providers/XWebinarProvider.cs @@ -289,7 +289,7 @@ namespace xWebinarService.Providers // await SendPush( action: XBaseEntityHubAction.Add.GetStringValue(), - payLoad: entity.ToJSON(), + payLoad: entity.ToJSON(camelCase: true), connectionId: connectionId ); @@ -443,7 +443,7 @@ namespace xWebinarService.Providers // await SendPush( action: XBaseEntityHubAction.Update.GetStringValue(), - payLoad: entity.ToJSON(), + payLoad: entity.ToJSON(camelCase: true), connectionId: connectionId ); } @@ -708,7 +708,7 @@ namespace xWebinarService.Providers // await SendPush( action: XBaseEntityHubAction.Delete.GetStringValue(), - payLoad: entity.ToJSON(), + payLoad: entity.ToJSON(camelCase: true), connectionId: connectionId ); } @@ -801,7 +801,7 @@ namespace xWebinarService.Providers // await SendPush( action: XWebinarEntityHubAction.Subscribe.GetStringValue(), - payLoad: entity.ToJSON(), + payLoad: entity.ToJSON(camelCase: true), connectionId: connectionId ); } @@ -927,7 +927,7 @@ namespace xWebinarService.Providers // await SendPush( action: XWebinarEntityHubAction.Unsubscribe.GetStringValue(), - payLoad: entity.ToJSON(), + payLoad: entity.ToJSON(camelCase: true), connectionId: connectionId ); }