public override object GetValue(string fieldName) { // Note: Only top-level fields filtering is supported Guard.NotNull("fieldName", fieldName); if (excludedFields.Contains(fieldName)) { throw CommonErrors.DataItemFieldNotFound(fieldName); } return(base.GetValue(fieldName)); }
public object GetValue(string fieldName) { Guard.NotNull("fieldName", fieldName); JToken token; if (!data.TryGetValue(fieldName, out token)) { throw CommonErrors.DataItemFieldNotFound(fieldName); } return(GetValue(token)); }
public object GetValue(string fieldName) { Guard.NotNull("fieldName", fieldName); AttributeValue value; if (!data.TryGetValue(fieldName, out value)) { throw CommonErrors.DataItemFieldNotFound(fieldName); } return(ConvertAttributeValue(value)); }
/// <summary> /// Provides a value of the specified data artifact field. /// </summary> /// <param name="fieldName">Name of data artifact field.</param> /// <returns>Value of the field.</returns> public object GetValue(string fieldName) { Guard.NotNull("fieldName", fieldName); object value; if (!fields.TryGetValue(fieldName, out value)) { throw CommonErrors.DataItemFieldNotFound(fieldName); } return(GetValue(value)); }
/// <summary> /// Provides a value of the specified data artifact field. /// </summary> /// <param name="fieldName">Name of data artifact field.</param> /// <returns>Value of the field.</returns> public object GetValue(string fieldName) { Guard.NotNull("fieldName", fieldName); object value; if (!fields.TryGetValue(fieldName, out value)) { throw CommonErrors.DataItemFieldNotFound(fieldName); } if (value is IReadOnlyDictionary <string, object> ) { return(new DictionaryDataItem((IReadOnlyDictionary <string, object>)value)); } return(value); }