コード例 #1
0
        public ApiError(ODataError oDataError) : this()
        {
            Error = new ApiErrorData
            {
                Code    = oDataError.ErrorCode ?? "",
                Message = oDataError.Message ?? "",
                Target  = oDataError.Target,
                Details = oDataError.Details?.Select(
                    x => new ApiErrorBody
                {
                    Code    = x.ErrorCode ?? "",
                    Message = x.Message ?? "",
                    Target  = x.Target
                }).ToList()
            };

            if (oDataError.InnerError != null)
            {
                Error.InnerError = new ApiErrorData.InnerErrorData
                {
                    AdditionalData = new Dictionary <string, JToken>(
                        oDataError.InnerError.Properties.Select(x =>
                                                                new KeyValuePair <string, JToken>(x.Key, JToken.FromObject(SerializeODataValue(x.Value)))))
                };
            }
        }
コード例 #2
0
 public ApiError()
 {
     Error = new ApiErrorData {
         Code = "", Message = ""
     };
 }