Filtering Data

In this article we'll:

  • Show only Orders with ShipCity = London
  • Show the different condition types: IsEqualTo, IsGreaterThan etc...
  • Explain that using Where.Add twice results in an 'And' relationship
  • Demo 'Or'
public class ShowOrders : UIControllerBase
{

    public readonly Models.Orders Orders = new Models.Orders();
    public ShowOrders()
    {
        From = Orders;
        Where.Add(Orders.ShipCity.IsEqualTo("London"));
    }
} 
public class ShowOrders : UIControllerBase
{

    public readonly Models.Orders Orders = new Models.Orders();
    public ShowOrders()
    {
        From = Orders;
        Where.Add(Orders.ShipCity.IsEqualTo("London"));
        Where.Add(Orders.ShipName.IsDifferentFrom(""));
    }
} 

demo 'Or'

public class ShowOrders : UIControllerBase
{

    public readonly Models.Orders Orders = new Models.Orders();
    public ShowOrders()
    {
        From = Orders;
        Where.Add(Orders.ShipCity.IsEqualTo("London").Or(
            Orders.ShipCity.IsEqualTo("Madrid")));
        Where.Add(Orders.ShipName.IsDifferentFrom(""));
    }
} 

See also: Other types of where


Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com