This is supplies a IFilterClause that can be supplied any string literal. The GetFilterClauseString will then supply the StringLiteral exactly as is.
This is typically used when you want to build a custom static filter clause which is more complex than a set of filters Anded.
E.g. (ParentID is null Or ParentID != 'fdafdas') and AssetID != 'fdafdas').
The potential limitations of using this is that you may limit the databases that this will port to. (In cases where the IFilterControl is being used in IFilterControl.FilterMode = FilterModes.Search.
This is typically used by the StringLiteralCustomFilter but can also be used independently public class ExcludeAssetCustomFilter : StaticCustomFilter { public override IFilterClause GetFilterClause(IFilterClauseFactory filterClauseFactory) { var stringLiteral = ""; if (AssetID != null) { stringLiteral = string.Format("AssetID <> '{0}'", AssetID.GetValueOrDefault().ToString("B")); } return new StringLiteralFilterClause(stringLiteral); } public Guid? AssetID { get; set; } }
Inheritance: IFilterClause
        public void Test_Construct_ShouldConstruct()
        {
            //---------------Set up test pack-------------------
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var filterClause = new StringLiteralFilterClause(RandomValueGen.GetRandomString());
            //---------------Test Result -----------------------
            Assert.IsNotNull(filterClause);
        }
 public void Test_GetStringLiteral_ShouldWork()
 {
     //---------------Set up test pack-------------------
     var expectedStringLiteral = RandomValueGen.GetRandomString();
     var filterClause = new StringLiteralFilterClause(expectedStringLiteral);
     //---------------Assert Precondition----------------
     //---------------Execute Test ----------------------
     var actualStringLiteral = filterClause.StringLiteral;
     //---------------Test Result -----------------------
     Assert.AreEqual(expectedStringLiteral, actualStringLiteral);
 }
        public void Test_GetFilterClauseString_WithParams_ShouldReturnStdString()
        {
            //---------------Set up test pack-------------------
            var expectedStringLiteral = RandomValueGen.GetRandomString();
            var filterClause = new StringLiteralFilterClause(expectedStringLiteral);
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var filterClauseString = filterClause.GetFilterClauseString("f", "f");
            //---------------Test Result -----------------------
            Assert.AreEqual(expectedStringLiteral, filterClauseString);
        }