示例#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)));
        }
示例#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();
 }
 public CqlBatch(MapperFactory mapperFactory, CqlGenerator cqlGenerator)
     : this(mapperFactory, cqlGenerator, BatchType.Logged)
 {
 }