/// <summary>
 /// Allows various objects to fire type change event.
 /// </summary>
 /// <param name="t"></param>
 internal static void FireTypeChangedEvent(Type t)
 {
     if (TypeConfigurationChanged != null)
     {
         CassandraConfiguration.TypeConfigurationChanged(t);
     }
 }
        /// <summary>
        ///
        /// </summary>
        /// <param name="exp"></param>
        /// <returns></returns>
        public IKeySetMapping <T> ForKey(Expression <Func <T, string> > exp)
        {
            var func = exp.Compile();
            var name = GetName(exp);

            _key = new KeyMappingExpression <T> {
                KeyAccessor = func,
                KeyName     = name
            };

            CassandraConfiguration.FireTypeChangedEvent(typeof(T));
            return((IKeySetMapping <T>)_key);
        }
        /// <summary>
        /// Looks up property names for use with aliases.
        /// </summary>
        /// <param name="sourcePropery">The source propery.</param>
        /// <returns></returns>
        public IPropertySetMapping <T> ForProperty(Expression <Func <T, object> > exp)
        {
            var func   = exp.Compile();
            var name   = GetName(exp);
            var mapExp = new PropertyMappingExpression <T> {
                PropertyAccessor = func,
                PropertyName     = name,
                Alias            = name         // this will get changed if the user calls UseAlias
            };

            _properties[name] = mapExp;

            CassandraConfiguration.FireTypeChangedEvent(typeof(T));
            return(mapExp);
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="type"></param>
 public void UseColumnType(ColumnType type)
 {
     ColumnType = type;
     CassandraConfiguration.FireTypeChangedEvent(typeof(T));
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="columnFamily"></param>
 public void UseColumnFamily(string columnFamily)
 {
     ColumnFamily = columnFamily;
     CassandraConfiguration.FireTypeChangedEvent(typeof(T));
 }