public static WithinRectangle ( string name, double lowerLeftX, double lowerLeftY, double upperRightX, double upperRightY ) : |
||
name | string | The name of the element to test. |
lowerLeftX | double | The x coordinate of the lower left corner. |
lowerLeftY | double | The y coordinate of the lower left corner. |
upperRightX | double | The x coordinate of the upper right corner. |
upperRightY | double | The y coordinate of the upper right corner. |
Результат |
public static QueryConditionList WithinRectangle(
string name,
double lowerLeftX,
double lowerLeftY,
double upperRightX,
double upperRightY)
{
if (name == null)
{
throw new ArgumentNullException("name");
}
return new QueryConditionList(name).WithinRectangle(lowerLeftX, lowerLeftY, upperRightX, upperRightY);
}
public void TestWithinRectangle() { var query = Query.WithinRectangle("loc", 1.1, 2.2, 3.3, 4.4); var expected = "{ 'loc' : { '$within' : { '$box' : [[1.1, 2.2], [3.3, 4.4]] } } }".Replace("'", "\""); Assert.AreEqual(expected, query.ToJson()); }