Class TemplateChangesValueProvider
Provides a method to get a value from an object, excluding any items from its parent template.
Implements
IValueProvider
Inherited Members
Namespace: Microsoft.XboxStudios.BotBrain
Assembly: BotBrain.Core.dll
Syntax
public class TemplateChangesValueProvider : IValueProvider
Remarks
This ensures a specific serialization behavior of templated lists, where children are added to the parent.
Constructors
View SourceTemplateChangesValueProvider(IValueProvider, Func<object, object?>)
Provides a method to get a value from an object, excluding any items from its parent template.
Declaration
public TemplateChangesValueProvider(IValueProvider valueProvider, Func<object, object?> getBasedOn)
Parameters
Type | Name | Description |
---|---|---|
IValueProvider | valueProvider | The default value provider. |
Func<object, object> | getBasedOn | Determines the template a given object is based on. |
Remarks
This ensures a specific serialization behavior of templated lists, where children are added to the parent.
Methods
View SourceGetValue(object)
Gets the value.
Declaration
public object? GetValue(object target)
Parameters
Type | Name | Description |
---|---|---|
object | target | The target to get the value from. |
Returns
Type | Description |
---|---|
object | The value. |
SetValue(object, object?)
Sets the value.
Declaration
public void SetValue(object target, object? value)
Parameters
Type | Name | Description |
---|---|---|
object | target | The target to set the value on. |
object | value | The value to set on the target. |
Implements
Newtonsoft.Json.Serialization.IValueProvider