public void Delete <T>(T poco, CqlQueryOptions queryOptions = null) { // Get the statement and bind values from POCO string cql = _cqlGenerator.GenerateDelete <T>(); Func <T, object[]> getBindValues = _mapperFactory.GetValueCollector <T>(cql, primaryKeyValuesOnly: true); object[] values = getBindValues(poco); Execute(Cql.New(cql, values, queryOptions ?? CqlQueryOptions.None)); }
public void Insert <T>(T poco, CqlQueryOptions queryOptions = null) { // Get statement and bind values from POCO string cql = _cqlGenerator.GenerateInsert <T>(); Func <T, object[]> getBindValues = _mapperFactory.GetValueCollector <T>(cql); object[] values = getBindValues(poco); Execute(Cql.New(cql, values, queryOptions ?? CqlQueryOptions.None)); }
public Task <List <T> > FetchAsync <T>(CqlQueryOptions options = null) { return(FetchAsync <T>(Cql.New(string.Empty, new object[0], options ?? CqlQueryOptions.None))); }
public List <T> Fetch <T>(CqlQueryOptions queryOptions = null) { // Just let the SQL be auto-generated return(Fetch <T>(Cql.New(string.Empty, new object[0], queryOptions ?? CqlQueryOptions.None))); }
internal static Cql New(string cql, object[] args, CqlQueryOptions queryOptions) { return(new Cql(cql, args, queryOptions)); }
private Cql(string cql, object[] args, CqlQueryOptions queryOptions) { Statement = cql; Arguments = args; QueryOptions = queryOptions; }
/// <summary> /// Creates a new Cql instance using the CQL string and bind variable values specified. /// </summary> public Cql(string cql, params object[] args) { Statement = cql; Arguments = args; QueryOptions = new CqlQueryOptions(); }