コード例 #1
0
        /// <summary>
        /// Reads single rule.
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task <(RuleInfo Data, DataStatus Status)> DataReadRuleAsync(int id)
        {
            var(rule, status) = await ReadRuleAsync(id);

            if (status.IsGood)
            {
                Data.UpdateRules(rule);
            }
            else
            {
                _logger?.LogError($"Error code {status.Code} in reading rule: {status.Explanation}.");
            }

            Data.Status = status;
            return(rule, Data.Status);
        }