Beispiel #1
0
        private async Task <TRes> CallProcessCommand <TCom, TRes>() where TCom : BaseCommand where TRes : BaseCommandResult, new()
        {
            var response = await m_appServiceConnection.SendMessageAsync(MessagingUtils.PackCommand <ValueSet>(new CheckCommand()));

            if (response.Status != AppServiceResponseStatus.Success)
            {
                return(new TRes()
                {
                    IsError = true
                });
            }

            var result = MessagingUtils.UnpackResult <BaseCommandResult>(response.Message);

            if (result is TRes)
            {
                return((TRes)result);
            }

            return(new TRes()
            {
                IsError = true
            });
        }