Class UdtMap
Represents a map between a user defined type in Cassandra and a .NET Type, with data on how
to map field names in the UDT to .NET property names.
Assembly: Cassandra.dll
Syntax
public abstract class UdtMap
Constructors
UdtMap(Type, string)
Declaration
protected UdtMap(Type netType, string udtName)
Parameters
UdtMap(Type, string, string)
Declaration
protected UdtMap(Type netType, string udtName, string keyspace)
Parameters
Fields
PropertyFlags
Declaration
public const BindingFlags PropertyFlags = IgnoreCase | Instance | Public | FlattenHierarchy
Field Value
_fieldNameToProperty
Declaration
protected readonly Dictionary<string, PropertyInfo> _fieldNameToProperty
Field Value
_propertyToFieldName
Declaration
protected readonly Dictionary<PropertyInfo, string> _propertyToFieldName
Field Value
Properties
Definition
Declaration
protected UdtColumnInfo Definition { get; set; }
Property Value
IgnoreCase
Declaration
protected bool IgnoreCase { get; set; }
Property Value
Keyspace
Declaration
protected string Keyspace { get; }
Property Value
NetType
Declaration
protected Type NetType { get; set; }
Property Value
UdtName
Declaration
protected string UdtName { get; set; }
Property Value
Methods
AddPropertyMapping(PropertyInfo, string)
Declaration
public void AddPropertyMapping(PropertyInfo propInfo, string udtFieldName)
Parameters
Automap()
Maps properties and fields by name
Declaration
protected virtual void Automap()
Build(UdtColumnInfo)
Builds the mapping using the Udt definition.
Sets the definition, validates the fields vs the mapped fields.
In case there isn't any property mapped defined, it auto maps the properties by name
Declaration
protected virtual void Build(UdtColumnInfo definition)
Parameters
CreateInstance()
Creates a new instance of the target .NET type
Declaration
protected virtual object CreateInstance()
Returns
For<T>(string, string)
Creates a new UdtMap for the specified .NET type, optionally mapped to the specified UDT name.
Declaration
public static UdtMap<T> For<T>(string udtName = null, string keyspace = null) where T : new()
Parameters
Returns
Type Parameters
GetPropertyForUdtField(string)
Gets the PropertyInfo that corresponds to the specified UDT field name.
Declaration
protected PropertyInfo GetPropertyForUdtField(string udtFieldName)
Parameters
Type |
Name |
Description |
string |
udtFieldName |
|
Returns
GetUdtFieldName(PropertyInfo)
Gets the UDT field name for a given property.
Declaration
protected string GetUdtFieldName(PropertyInfo property)
Parameters
Returns