Esempio n. 1
0
        static void Main(string[] args)
        {
            const string connectionString = "Data Source=dev-app3.abax.local;Initial Catalog=ETS;User Id=T2F_Web;password=ets;MultipleActiveResultSets=True";

            var schema = DbSchemaReader.ReadTableSchema(() => new SqlConnection(connectionString), "dbo.GpsTrip");

//            var properties = schema.Select(PropertyDefinitionFactory.FromDbColumnInfo).ToArray();

//            Console.WriteLine(properties.Length);
        }
        public async Task Initialize()
        {
            Log.Debug("Initializing single table queue gateway");

            var schema = await DbSchemaReader.ReadTableSchema(_connectionFactory, _tableName).ConfigureAwait(false);

            _properties  = schema.Where(x => x.Name.ToLower() != "rownumber").Select(FromDbColumnInfo).ToArray();
            _messageType = MessageTypeProvider.BuildMessageType(new MessageTypeDefinition(_type, _properties));

            Log.Debug("Initialization complete");
        }
        public async Task Initialize()
        {
            Log.Debug("Initializing JSON table queue gateway");

            var schema = (await DbSchemaReader.ReadTableSchema(_connectionFactory, _tableName).ConfigureAwait(false)).ToArray();

            ExpectColumnType(schema, _columnNames.Timestamp, typeof(DateTime));
            ExpectColumnType(schema, _columnNames.MessageType, typeof(string));
            ExpectColumnType(schema, _columnNames.Payload, typeof(string));

            Log.Debug("Initialization complete");
        }