This commit is contained in:
jozsef.b@aycode.com 2024-06-01 16:09:54 +02:00
parent 7c81e2b596
commit 968e7a1c41
2 changed files with 4 additions and 26 deletions

View File

@ -100,7 +100,6 @@ namespace TIAMSharedUI.Shared.Components.Grids
var dataItem = (e.EditModel as TDataItem)!;
var logText = e.IsNew ? "add" : "update";
Logger.Info($"{_gridLogName} OnItemSaving {logText}; Id: {dataItem.Id}");
await OnDataItemSaving.InvokeAsync(e);

View File

@ -25,7 +25,7 @@ public static class ExtensionMethods
{
public static object? InvokeMethod(this MethodInfo methodInfo, object obj, params object[]? parameters)
{
if (methodInfo.GetCustomAttribute(typeof(AsyncStateMachineAttribute)) is AsyncStateMachineAttribute isTaks)
if (methodInfo.GetCustomAttribute(typeof(AsyncStateMachineAttribute)) is AsyncStateMachineAttribute isAsyncTask)
{
dynamic awaitable = methodInfo.Invoke(obj, parameters)!;
return awaitable.GetAwaiter().GetResult();
@ -116,14 +116,6 @@ public class DevAdminSignalRHub : Hub<ISignalRHubItemServer>, IAcSignalRHubServe
await base.OnDisconnectedAsync(exception);
}
//public async Task OnRequestMessage(int messageTag, int requestId)
//{
// _logger.Info($"Server OnRequestMessage; {nameof(messageTag)}: {messageTag}; {nameof(requestId)}: {requestId}; ConnectionId: {Context.ConnectionId}; UserIdentifier: {Context.UserIdentifier}");
// if (messageTag == SignalRTags.GetTransfersAsync)
// await ResponseToCaller(SignalRTags.PostTransfersAsync, await adminDal.GetTransfersJsonAsync(), requestId);
//}
public async Task OnReceiveMessage(int messageTag, byte[]? message, int? requestId)
{
var logText = $"Server OnReceiveMessage; {nameof(messageTag)}: {messageTag}; {nameof(requestId)}: {requestId}; ConnectionId: {Context.ConnectionId}; UserIdentifier: {Context.UserIdentifier}";
@ -146,15 +138,9 @@ public class DevAdminSignalRHub : Hub<ISignalRHubItemServer>, IAcSignalRHubServe
_logger.Debug($"{logText}({methodInfoModel.ParameterType.Name})");
paramValues = new object[1];
if (methodInfoModel.ParameterType == typeof(Guid) || methodInfoModel.ParameterType == typeof(Guid?))
{
paramValues[0] = message!.MessagePackTo<SignalRequestByIdMessage>().Id;
}
else
{
var msg = message!.MessagePackTo<SignalPostJsonDataMessage<object>>(MessagePackSerializerOptions.Standard);
paramValues[0] = msg.PostDataJson.JsonTo(methodInfoModel.ParameterType)!;
}
if (methodInfoModel.ParameterType == typeof(Guid) || methodInfoModel.ParameterType == typeof(Guid?)) paramValues[0] = message!.MessagePackTo<SignalRequestByIdMessage>().Id;
else paramValues[0] = message!.MessagePackTo<SignalPostJsonDataMessage<object>>(MessagePackSerializerOptions.Standard).PostDataJson.JsonTo(methodInfoModel.ParameterType)!;
}
else _logger.Debug($"{logText}()");
@ -231,13 +217,6 @@ public class DevAdminSignalRHub : Hub<ISignalRHubItemServer>, IAcSignalRHubServe
await sendTo.OnReceiveMessage(messageTag, message.ToMessagePack(ContractlessStandardResolver.Options), requestId);
}
//protected void SendRequestToClient(ISignalRHubItemServer sendTo, int messageTag, int requestId)
//{
// _logger.Info($"Server SendRequestToClient; {nameof(messageTag)}: {messageTag}; {nameof(requestId)}: {requestId}; ConnectionId: {Context.ConnectionId}; UserIdentifier: {Context.UserIdentifier}");
// sendTo.OnRequestMessage(messageTag, requestId).Forget();
//}
public async Task SendMessageToGroup(string groupId, int messageTag, string message)
{
//await Clients.Group(groupId).Post("", messageTag, message);