sdk/dotnet/src/Microsoft.Datasync.Client/Offline/Queue/TableOperationError.cs
/// <summary>
/// Deserialize an operation error from the offline store.
/// </summary>
/// <param name="obj">The <see cref="JObject"/> version of the oepration error received from the offline store.</param>
/// <param name="serializerSettings">The serializer settings.</param>
/// <returns>The deserialized <see cref="TableOperationError"/>.</returns>
Deserialize an operation error from the offline store.
Deserialize an operation error from the offline store .
internal static TableOperationError Deserialize(JObject obj, DatasyncSerializerSettings serializerSettings)
        {
            string id = obj.Value<string>(SystemProperties.JsonIdProperty);
            HttpStatusCode? status = obj.ContainsKey("status") ? (HttpStatusCode?)obj.Value<int?>("status") : null;
            long version = obj.Value<long?>("version").GetValueOrDefault();
            TableOperationKind operationKind = (TableOperationKind)obj.Value<int>("kind");
            string tableName = obj.Value<string>("tableName");
            string itemStr = obj.Value<string>("item");
            JObject item = itemStr == null ? null : JObject.Parse(itemStr);
            string rawResult = obj.Value<string>("rawResult");
            JObject result = null;
            if (rawResult != null)
            {
                try
                {
                    result = JsonConvert.DeserializeObject<JObject>(rawResult, serializerSettings);
                }
                catch (JsonReaderException)
                {
                }
            }
            return new TableOperationError(id, version, operationKind, status, tableName, item, rawResult, result);
        }
internal static TableOperationError Deserialize ( JObject obj , DatasyncSerializerSettings serializerSettings ) { string id = obj . Value < string > ( SystemProperties . JsonIdProperty ) ; HttpStatusCode ? status = obj . ContainsKey ( " " ) ? ( HttpStatusCode ? ) obj . Value < int ? > ( " " ) : null ; long version = obj . Value < long ? > ( " " ) . GetValueOrDefault ( ) ; TableOperationKind operationKind = ( TableOperationKind ) obj . Value < int > ( " " ) ; string tableName = obj . Value < string > ( " " ) ; string itemStr = obj . Value < string > ( " " ) ; JObject item = itemStr == null ? null : JObject . Parse ( itemStr ) ; string rawResult = obj . Value < string > ( " " ) ; JObject result = null ; if ( rawResult != null ) { try { result = JsonConvert . DeserializeObject < JObject > ( rawResult , serializerSettings ) ; } catch ( JsonReaderException ) { } } return new TableOperationError ( id , version , operationKind , status , tableName , item , rawResult , result ) ; }
Deserialize an operation error from the offline store.
Deserialize an operation error from the offline store .
// Get the relevant values from the JObject. // Ignore JsonReaderException, because 'rawResult' might not be JSON.
The deserialized .
The deserialized .
obj
JObject
The  version of the oepration error received from the offline store.
The version of the oepration error received from the offline store .
serializerSettings
DatasyncSerializerSettings
The serializer settings.
The serializer settings .