Class MemberDefinition
- Namespace
- Alis.Core.Aspect.Data.Json
- Assembly
- Alis.dll
Defines a type's member.
public sealed class MemberDefinitionInheritance
Inherited Members
Fields
_accessor
The accessor
private IMemberAccessor _accessorField Value
_escapedWireName
The escaped wire name
private string _escapedWireNameField Value
_name
The name
private string _nameField Value
_type
The type
private Type _typeField Value
_wireName
The wire name
private string _wireNameField Value
Properties
Accessor
Gets or sets the accessor.
public IMemberAccessor Accessor { get; set; }Property Value
DefaultValue
Gets or sets the default value.
public object DefaultValue { get; set; }Property Value
EscapedWireName
Gets or sets the escaped name used during serialization and des-serialization.
public string EscapedWireName { get; set; }Property Value
HasDefaultValue
Gets or sets a value indicating whether this instance has default value.
public bool HasDefaultValue { get; set; }Property Value
Name
Gets or sets the member name.
public string Name { get; set; }Property Value
Type
Gets or sets the member type.
public Type Type { get; set; }Property Value
WireName
Gets or sets the name used for serialization and des-serialization.
public string WireName { get; set; }Property Value
Methods
AddDeserializationMember(Type, JsonOptions, MemberDefinition)
Adds a deserialization member.
public static void AddDeserializationMember(Type type, JsonOptions options, MemberDefinition member)Parameters
typeType-
The type. May not be null.
optionsJsonOptions-
The options. May be null.
memberMemberDefinition-
The member. May not be null.
AddSerializationMember(Type, JsonOptions, MemberDefinition)
Adds a serialization member.
public static void AddSerializationMember(Type type, JsonOptions options, MemberDefinition member)Parameters
typeType-
The type. May not be null.
optionsJsonOptions-
The options. May be null.
memberMemberDefinition-
The member. May not be null.
ApplyEntry(IDictionary, object, string, object, JsonOptions)
Applies the dictionary entry to this member.
public void ApplyEntry(IDictionary dictionary, object target, string key, object value, JsonOptions options = null)Parameters
dictionaryIDictionary-
The input dictionary.
targetobject-
The target object.
keystring-
The entry key.
valueobject-
The entry value.
optionsJsonOptions-
The options.
EqualsDefaultValue(object)
Determines if a value equals the default value.
public bool EqualsDefaultValue(object value)Parameters
valueobject-
The value to compare.
Returns
- bool
-
true if both values are equal; false otherwise.
GetDeserializationMembers(Type, JsonOptions)
Gets the deserialization members for a given type.
public static MemberDefinition[] GetDeserializationMembers(Type type, JsonOptions options = null)Parameters
typeType-
The type. May not be null.
optionsJsonOptions-
The options. May be null.
Returns
- MemberDefinition[]
-
A list of deserialization members.
GetOrCreateInstance(object, int, JsonOptions)
Gets or creates a member instance.
private object GetOrCreateInstance(object target, int elementsCount, JsonOptions options = null)Parameters
targetobject-
The target.
elementsCountint-
The elements count.
optionsJsonOptions-
The options.
Returns
- object
-
A new or existing instance.
GetSerializationMembers(Type, JsonOptions)
Gets the serialization members for a given type.
public static MemberDefinition[] GetSerializationMembers(Type type, JsonOptions options = null)Parameters
typeType-
The type. May not be null.
optionsJsonOptions-
The options. May be null.
Returns
- MemberDefinition[]
-
A list of serialization members.
IsNullDateTimeValue(object)
Determines whether the specified value is equal to the zero value for its type.
public bool IsNullDateTimeValue(object value)Parameters
valueobject-
The value.
Returns
- bool
-
true if the specified value is equal to the zero value.
IsZeroValue(object)
Determines whether the specified value is equal to the zero value for its type.
public bool IsZeroValue(object value)Parameters
valueobject-
The value.
Returns
- bool
-
true if the specified value is equal to the zero value.
RemoveDeserializationMember(Type, JsonOptions, MemberDefinition)
Removes a deserialization member.
public static bool RemoveDeserializationMember(Type type, JsonOptions options, MemberDefinition member)Parameters
typeType-
The type. May not be null.
optionsJsonOptions-
The options. May be null.
memberMemberDefinition-
The member. May not be null.
Returns
- bool
-
true if item is successfully removed; otherwise, false.
RemoveSerializationMember(Type, JsonOptions, MemberDefinition)
Removes a serialization member.
public static bool RemoveSerializationMember(Type type, JsonOptions options, MemberDefinition member)Parameters
typeType-
The type. May not be null.
optionsJsonOptions-
The options. May be null.
memberMemberDefinition-
The member. May not be null.
Returns
- bool
-
true if item is successfully removed; otherwise, false.
ToString()
Returns a System.String that represents this instance.
public override string ToString()Returns
- string
-
A System.String that represents this instance.
UsingLock<T>(Action<T>, T)
Run a specified action, using the member definition lock.
public static void UsingLock<T>(Action<T> action, T state)Parameters
actionAction<T>-
The action. May not be null.
stateT-
The state. May be null.
Type Parameters
T-
The action input type.