Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
 public Task <List <T> > FetchAsync <T>(CqlQueryOptions options = null)
 {
     return(FetchAsync <T>(Cql.New(string.Empty, new object[0], options ?? CqlQueryOptions.None)));
 }
Esempio n. 4
0
 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)));
 }
Esempio n. 5
0
 internal static Cql New(string cql, object[] args, CqlQueryOptions queryOptions)
 {
     return(new Cql(cql, args, queryOptions));
 }
Esempio n. 6
0
 private Cql(string cql, object[] args, CqlQueryOptions queryOptions)
 {
     Statement    = cql;
     Arguments    = args;
     QueryOptions = queryOptions;
 }
Esempio n. 7
0
 /// <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();
 }