[This is preliminary documentation and is subject to change.]

Encapsulates a custom filter.

Namespace:  Firefly.Box.Data.Advanced
Assembly:  Firefly.Box (in Firefly.Box.dll) Version: (


public interface ICustomFilterMember
Visual Basic (Declaration)
Public Interface ICustomFilterMember
Visual C++
public interface class ICustomFilterMember


Used in advanced custom filter situation, in which there is a need for a custom filter and a will to encapsulate it to prevent misuse.


This example is in the form of Unit Tests. It references the NUnit framework. This framework can be downloaded from www.NUnit.org. For more information about unit testing visit: www.NUnit.org.
This example is based on test data. The code for the entities included in this test data can be found in the documentation of Entity
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using Firefly.Box.Data;
using Firefly.Box.Data.Advanced;
using NUnit.Framework;
using Firefly.Box;
using Firefly.Box.Testing;

namespace TestFirefly.Box.Documentation
    public class CustomFilterMemberDemo
        public void UsageOfCustomMemberDemo()
            var employees = new Pubs.Employees();
            var bp = new BusinessProcess
                From = employees
            bp.Where.Add("{0}", new DBIn(employees.JobId,1,3,5,7));//See the DBIn class below

        class DBIn : ICustomFilterMember
            NumberColumn _column;
            Number[] _values;

            public DBIn(NumberColumn column, params Number[] values)
                _values = values;
                _column = column;

            public void SendFilterTo(CustomFilterCollector sendFilterString)
                var args = new ArrayList();
                var inFunctionArguments = "";
                // Create the inside of the in method syntax according to the number of parameters received in the values.
                //For a dynamic number of parameters - for Example for three parameters it should look like "{1}, {2}, {3}
                foreach (var value in _values)
                    if (inFunctionArguments.Length != 0)
                        inFunctionArguments += ", ";
                    inFunctionArguments += "{" + args.Count + "}";
                sendFilterString("{0} in (" + inFunctionArguments + ")", args.ToArray());

See Also