Exemplo n.º 1
0
        /// <summary>
        /// Adapts a LWT RowSet and returns a new AppliedInfo
        /// </summary>
        internal static AppliedInfo <T> FromRowSet(MapperFactory mapperFactory, string cql, RowSet rs)
        {
            var          row           = rs.FirstOrDefault();
            const string appliedColumn = "[applied]";

            if (row == null || row.GetColumn(appliedColumn) == null || row.GetValue <bool>(appliedColumn))
            {
                //The change was applied correctly
                return(new AppliedInfo <T>(true));
            }
            if (rs.Columns.Length == 1)
            {
                //There isn't more information on why it was not applied
                return(new AppliedInfo <T>(false));
            }
            //It was not applied, map the information returned
            var mapper = mapperFactory.GetMapper <T>(cql, rs);

            return(new AppliedInfo <T>(mapper(row)));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Clears all the mapping defined for this instance
 /// </summary>
 internal void Clear()
 {
     _typeDefinitions = new LookupKeyedCollection <Type, ITypeDefinition>(td => td.PocoType);
     MapperFactory    = new MapperFactory(_typeConverter, new PocoDataFactory(_typeDefinitions));
     StatementFactory = new StatementFactory();
 }
Exemplo n.º 3
0
 public CqlBatch(MapperFactory mapperFactory, CqlGenerator cqlGenerator)
     : this(mapperFactory, cqlGenerator, BatchType.Logged)
 {
 }