public static CassandraObject GetCassandraObjectFromObject(object obj) { var sourceType = obj.GetType(); var cassandraType = CassandraType.GetCassandraType(sourceType); return(GetCassandraObjectFromObject(obj, cassandraType)); }
public static CassandraObject GetCassandraObjectFromObject(object obj, CassandraType cassandraType = null) { if (cassandraType == null) { var sourceType = obj.GetType(); cassandraType = CassandraType.GetCassandraType(sourceType); } if (obj == null) { return(null); } if (obj is CassandraObject) { return(((CassandraObject)obj).GetValue(cassandraType)); } var type = cassandraType.CreateInstance(); if (type == null) { return(null); } type.SetValue(obj); return(type); }
public object GetValue(Type type) { if (type.BaseType == typeof(CassandraObject)) { return(GetValue(CassandraType.GetCassandraType(type))); } return(GetValueInternal(type)); }
public static CassandraObject GetCassandraObjectFromObject(object obj, string type) { var cassandraType = CassandraType.GetCassandraType(type); return(GetCassandraObjectFromObject(obj, cassandraType)); }
public static CassandraObject GetCassandraObjectFromDatabaseByteArray(byte[] value, string type) { var cassandraType = CassandraType.GetCassandraType(type); return(GetCassandraObjectFromDatabaseByteArray(value, cassandraType)); }
public CassandraType GetCassandraType() { return(CassandraType.GetCassandraType(this)); }