internal static MobileServiceTableOperationError Deserialize(JObject obj, MobileServiceJsonSerializerSettings settings) { HttpStatusCode?status = null; if (obj["httpStatus"] != null) { status = (HttpStatusCode?)obj.Value <int?>("httpStatus"); } string id = obj.Value <string>(MobileServiceSystemColumns.Id); long operationVersion = obj.Value <long?>("operationVersion").GetValueOrDefault(); MobileServiceTableOperationKind operationKind = (MobileServiceTableOperationKind)obj.Value <int>("operationKind"); var tableName = obj.Value <string>("tableName"); var tableKind = (MobileServiceTableKind)obj.Value <int?>("tableKind").GetValueOrDefault(); string itemStr = obj.Value <string>("item"); JObject item = itemStr == null ? null : JObject.Parse(itemStr); string rawResult = obj.Value <string>("rawResult"); var result = rawResult.ParseToJToken(settings) as JObject; return(new MobileServiceTableOperationError(id, operationVersion, operationKind, status, tableName, item, rawResult, result) { Id = id, TableKind = tableKind }); }
/// <summary> /// Initializes an instance of <see cref="MobileServiceTableOperationError"/> /// </summary> /// <param name="id">The id of error that is same as operation id.</param> /// <param name="operationVersion">The version of the operation.</param> /// <param name="operationKind">The kind of table operation.</param> /// <param name="status">The HTTP status code returned by server.</param> /// <param name="tableName">The name of the remote table.</param> /// <param name="item">The item associated with the operation.</param> /// <param name="rawResult">Raw response of the table operation.</param> /// <param name="result">Response of the table operation.</param> public MobileServiceTableOperationError(string id, long operationVersion, MobileServiceTableOperationKind operationKind, HttpStatusCode?status, string tableName, JObject item, string rawResult, JObject result) { this.Id = id; this.OperationVersion = operationVersion; this.Status = status; this.OperationKind = operationKind; this.TableName = tableName; this.Item = item; this.RawResult = rawResult; this.Result = result; }
/// <summary> /// Initializes an instance of <see cref="MobileServiceTableOperationError"/> /// </summary> /// <param name="id">The id of error that is same as operation id.</param> /// <param name="operationVersion">The version of the operation.</param> /// <param name="operationKind">The kind of table operation.</param> /// <param name="status">The HTTP status code returned by server.</param> /// <param name="tableName">The name of the remote table.</param> /// <param name="item">The item associated with the operation.</param> /// <param name="rawResult">Raw response of the table operation.</param> /// <param name="result">Response of the table operation.</param> public MobileServiceTableOperationError(string id, long operationVersion, MobileServiceTableOperationKind operationKind, HttpStatusCode? status, string tableName, JObject item, string rawResult, JObject result) { this.Id = id; this.OperationVersion = operationVersion; this.Status = status; this.OperationKind = operationKind; this.TableName = tableName; this.Item = item; this.RawResult = rawResult; this.Result = result; }