Пример #1
0
        static async Task<bool> TryOnClient(Func<Task<string>> operationOnClient, ILogger logger)
        {
            try
            {
                var result = await operationOnClient();

                return 
                    result != null
                    &&
                    result.Equals(
                        SuccessResult,
                        StringComparison.InvariantCultureIgnoreCase);
            }
            catch (Exception ex)
            {
                logger.ToErrorLogDigest(ex);
                return false;
            }
        }