public AdoStarParametersReader(IConnectionContext output, Process parent, IConnectionFactory cf, IRowFactory rowFactory)
 {
     _output     = output;
     _parent     = parent;
     _cf         = cf;
     _rowCreator = new AdoRowCreator(output, rowFactory);
 }
 public AdoInputReader(InputContext input, Field[] fields, IConnectionFactory factory, IRowFactory rowFactory)
 {
     _input      = input;
     _fields     = fields;
     _factory    = factory;
     _rowCreator = new AdoRowCreator(input, rowFactory);
 }
        public AdoEntityMatchingFieldsReader(InputContext input, IConnectionFactory cf, IRowFactory rowFactory)
        {
            var tempTable = input.Entity.GetExcelName();

            _keys       = input.Entity.GetPrimaryKey();
            _input      = input;
            _cf         = cf;
            _create     = SqlCreateKeysTable(input, cf, tempTable);
            _insert     = SqlInsertTemplate(input, tempTable);
            _query      = SqlQuery(input, cf, tempTable);
            _drop       = SqlDrop(input, tempTable);
            _rowCreator = new AdoRowCreator(input, rowFactory);
        }
 public AdoEntityMatchingKeysReader(IConnectionContext context, IConnectionFactory cf, IRowFactory rowFactory)
 {
     _tempTable = (cf.AdoProvider == AdoProvider.SqlServer ? "#" : string.Empty) + context.Entity.GetExcelName();
     _context   = context;
     _keys      = context.Entity.GetPrimaryKey();
     _cf        = cf;
     _hashCode  = context.Entity.TflHashCode();
     _deleted   = context.Entity.TflDeleted();
     _fields    = new List <Field>(_keys)
     {
         _hashCode, _deleted
     }.ToArray();
     _rowCreator = new AdoRowCreator(context, rowFactory);
 }
示例#5
0
 public AdoReader(IConnectionContext context, Field[] fields, IConnectionFactory cf, IRowFactory rowFactory, ReadFrom readFrom)
 {
     _context    = context;
     _cf         = cf;
     _connection = readFrom == ReadFrom.Output
         ? context.Process.Connections.First(c => c.Name == "output")
         : context.Process.Connections.First(c => c.Name == context.Entity.Connection);
     _tableOrView  = readFrom == ReadFrom.Output ? context.Entity.OutputTableName(context.Process.Name) : context.Entity.Name;
     _schemaPrefix = readFrom == ReadFrom.Output ? string.Empty : (context.Entity.Schema == string.Empty ? string.Empty : cf.Enclose(context.Entity.Schema) + ".");
     _filter       = readFrom == ReadFrom.Output ? $"WHERE {cf.Enclose(_context.Entity.TflDeleted().FieldName())} != 1" : string.Empty;
     _fields       = fields;
     _readFrom     = readFrom;
     _rowCreator   = new AdoRowCreator(context, rowFactory);
 }