Example #1
0
    static FilterQueryResult <T>?CombineFilterResult <T>(FilterQueryResult <T>?one, FilterQueryResult <T> two)
        where T : Entity
    {
        if (one == null)
        {
            return(two);
        }

        if (two == null)
        {
            return(one);
        }

        return(new FilterQueryResult <T>(
                   a => one !.InDatabaseExpresson.Evaluate(a) && two.InDatabaseExpresson.Evaluate(a),
                   a => one !.InMemoryFunction !(a) && two !.InMemoryFunction !(a)));
    }
Example #2
0
    internal FilterQueryResult <T>?OnFilterQuery <T>()
        where T : Entity
    {
        AssertAllowed(typeof(T), inUserInterface: false);

        EntityEvents <T>?ee = (EntityEvents <T>?)entityEvents.TryGetC(typeof(T));

        if (ee == null)
        {
            return(null);
        }

        FilterQueryResult <T>?result = null;

        foreach (var item in ee.OnFilterQuery())
        {
            result = CombineFilterResult(result, item);
        }

        return(result);
    }