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.
Inheritance
object
UdtMap
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Assembly: Cassandra.dll
Syntax
public abstract class UdtMap
Constructors
UdtMap(Type, string, string)
Declaration
protected UdtMap(Type netType, string udtName, string keyspace)
Parameters
Type |
Name |
Description |
Type |
netType |
|
string |
udtName |
|
string |
keyspace |
|
UdtMap(Type, string)
Declaration
protected UdtMap(Type netType, string udtName)
Parameters
Type |
Name |
Description |
Type |
netType |
|
string |
udtName |
|
Fields
_fieldNameToProperty
Declaration
protected readonly Dictionary<string, PropertyInfo> _fieldNameToProperty
Field Value
Type |
Description |
Dictionary<string, PropertyInfo> |
|
_propertyToFieldName
Declaration
protected readonly Dictionary<PropertyInfo, string> _propertyToFieldName
Field Value
Type |
Description |
Dictionary<PropertyInfo, string> |
|
PropertyFlags
Declaration
public const BindingFlags PropertyFlags = IgnoreCase | Instance | Public | FlattenHierarchy
Field Value
Type |
Description |
BindingFlags |
|
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
Type |
Name |
Description |
PropertyInfo |
propInfo |
|
string |
udtFieldName |
|
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
Type |
Name |
Description |
string |
udtName |
|
string |
keyspace |
|
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
Type |
Description |
PropertyInfo |
|
GetUdtFieldName(PropertyInfo)
Gets the UDT field name for a given property.
Declaration
protected string GetUdtFieldName(PropertyInfo property)
Parameters
Type |
Name |
Description |
PropertyInfo |
property |
|
Returns