예제 #1
0
 public void CleanUp()
 {
     using (var connection = _connectionFactory.CreateConnection())
     {
         Spry.Delete().From("CustomerAddress").Execute(connection);
         Spry.Delete().From("Customer").Execute(connection);
     }
 }
예제 #2
0
        public bool Delete(int customerId)
        {
            using (var connection = _connectionFactory.CreateConnection())
            {
                var rowsDeleted = Spry.Delete <Customer>()
                                  .From(CUSTOMER_TABLE)
                                  .Where(_ => customerId).EqualTo(customerId)
                                  .Execute(connection);

                return(rowsDeleted == 1);
            }
        }