src/Cassandra/UdtMappingDefinitions.cs
/// <summary>
/// Add mapping definition(s) for UDTs, specifying how UDTs should be mapped to .NET types and vice versa.
/// </summary>
/// <exception cref="ArgumentException" />
Add mapping definition(s) for UDTs, specifying how UDTs should be mapped to .NET types and vice versa.
Add mapping definition ( s ) for UDTs specifying how UDTs should be mapped to . NET types and vice versa .
public async Task DefineAsync(params UdtMap[] udtMaps)
        {
            if (udtMaps == null)
            {
                throw new ArgumentNullException("udtMaps");
            }
            var keyspace = _session.Keyspace;
            if (String.IsNullOrEmpty(keyspace))
            {
                throw new ArgumentException("It is not possible to define a mapping when no keyspace is specified.");
            }
            if (_session.BinaryProtocolVersion < 3)
            {
                throw new NotSupportedException("User defined type mapping is supported with C* 2.1+ and protocol version 3+");
            }
            foreach (var map in udtMaps)
            {
                var udtDefition = await GetDefinitionAsync(keyspace, map).ConfigureAwait(false);
                map.SetSerializer(_serializer);
                map.Build(udtDefition);
                _serializer.SetUdtMap(udtDefition.Name, map);
                _udtByNetType.AddOrUpdate(map.NetType, map, (k, oldValue) => map);
            }
        }
public async Task DefineAsync ( params UdtMap [ ] udtMaps ) { if ( udtMaps == null ) { throw new ArgumentNullException ( " " ) ; } var keyspace = _session . Keyspace ; if ( String . IsNullOrEmpty ( keyspace ) ) { throw new ArgumentException ( " " ) ; } if ( _session . BinaryProtocolVersion < 3 ) { throw new NotSupportedException ( " " ) ; } foreach ( var map in udtMaps ) { var udtDefition = await GetDefinitionAsync ( keyspace , map ) . ConfigureAwait ( false ) ; map . SetSerializer ( _serializer ) ; map . Build ( udtDefition ) ; _serializer . SetUdtMap ( udtDefition . Name , map ) ; _udtByNetType . AddOrUpdate ( map . NetType , map , ( k , oldValue ) => map ) ; } }
Add mapping definition(s) for UDTs, specifying how UDTs should be mapped to .NET types and vice versa.
Add mapping definition ( s ) for UDTs specifying how UDTs should be mapped to . NET types and vice versa .
// Add types to both indexes
None