Example #1
0
 public GetCustomersHandler()
 {
     _innerHandler = new DapperQueryHandler <GetCustomers, Customer[]>((data, command) =>
     {
         command.CommandText = QueriesResolver.CreateTableFor <Customer>();
         command.CommandText = QueriesResolver.SelectFor <Customer>();
         return(command.ExecuteReader().Parse <Customer>().ToArray());
     });
 }
        public AddCustomerHandler()
        {
            _innerHandler = new DapperCommandHandler <AddCustomer, object>((command, connection) =>
            {
                connection.ConnectionString = ConnectionString;
                var createTableQuery        = QueriesResolver.CreateTableFor <Customer>();
                var selectQuery             = QueriesResolver.SelectFor <Customer>();

                return(connection.Execute("INSERT INTO CUSTOMERS (ID, Firstname, Lastname) Values(@ID,@Firstname,@Lastname)", command));
            });
        }