public void WhereOr() { var q = Builders <MyModel> .Select(x => new { x.Id }) .Where(x => x.Id == 1 || x.Name == "test"); var b = WhereBuilder <MyModel> .Or( WhereBuilder <MyModel> .Eq(x => x.Id, 1), WhereBuilder <MyModel> .Eq(x => x.Name, "test")); Utils.AssertRawQuery(q, b, @"SELECT ""id"" FROM model WHERE ((""id"") = (1)) OR ((""name"") = ('test'))"); }
public void WhereAnd() { var q = Builders <MyModel> .Select(x => new { x.Id }) .Where(x => x.Id == 1 && x.Name == "test"); var b = WhereBuilder <MyModel> .And( WhereBuilder <MyModel> .FromExpression(x => x.Id == 1), WhereBuilder <MyModel> .Eq(x => x.Name, "test")); Utils.AssertRawQuery(q, b, @"SELECT ""id"" FROM model WHERE ((""id"") = (1)) AND ((""name"") = ('test'))"); }