[]
Adds a property to the JSON object coder with the specified name, getter, and coder.
public JsonObjectCoderBuilder<TObject> Prop<TProperty>(string name, Expression<Func<TObject, TProperty>> getter, JsonCoder<TProperty> coder, Func<TProperty, bool> skipOnWrite = null)
Type | Name | Description |
---|---|---|
string | name | A string value indicating the name of the property in the JSON object. |
Expression<Func<TObject, TProperty>> | getter | An Expression object to get the property value from the object. |
JsonCoder<TProperty> | coder | A JsonCoder<T> used to encode and decode the property value. |
Func<TProperty, bool> | skipOnWrite | A function with condition to skip writing the property. |
Type | Description |
---|---|
JsonObjectCoderBuilder<TObject> | The current instance of JsonObjectCoderBuilder<TObject>. |
Name | Description |
---|---|
TProperty | The type of the property. |
Adds a property to the JSON object coder with the specified getter and coder. The property name is derived from the expression.
public JsonObjectCoderBuilder<TObject> Prop<TProperty>(Expression<Func<TObject, TProperty>> getter, JsonCoder<TProperty> coder, Func<TProperty, bool> skipOnWrite = null)
Type | Name | Description |
---|---|---|
Expression<Func<TObject, TProperty>> | getter | An Expression object to get the property value from the object. |
JsonCoder<TProperty> | coder | A JsonCoder<T> used to encode and decode the property value. |
Func<TProperty, bool> | skipOnWrite | A function with condition to skip writing the property. |
Type | Description |
---|---|
JsonObjectCoderBuilder<TObject> | The current instance of JsonObjectCoderBuilder<TObject>. |
Name | Description |
---|---|
TProperty | The type of the property. |
Adds a property to the JSON object coder with the specified name, coder, getter function, and setter function.
public JsonObjectCoderBuilder<TObject> Prop<TProperty>(string name, JsonCoder<TProperty> coder, Func<TObject, TProperty> getterFn, Action<TObject, TProperty> setterFn, Func<TProperty, bool> skipOnWrite = null)
Type | Name | Description |
---|---|---|
string | name | A string value indicating the name of the property in the JSON object. |
JsonCoder<TProperty> | coder | A JsonCoder<T> used to encode and decode the property value. |
Func<TObject, TProperty> | getterFn | A function to get the property value from the object. |
Action<TObject, TProperty> | setterFn | An action to set the property value in the object. |
Func<TProperty, bool> | skipOnWrite | A function with condition to skip writing the property. |
Type | Description |
---|---|
JsonObjectCoderBuilder<TObject> | The current instance of JsonObjectCoderBuilder<TObject>. |
Name | Description |
---|---|
TProperty | The type of the property. |