/// <summary> /// Add an comparison for the objectClass, if possible use IsObjectCategory as this has a higher chance of being /// indexed. /// </summary> /// <param name="objectClass">string with the objectClass</param> /// <returns>Query</returns> public Query WhereObjectClassIs(Value objectClass) { return Where("objectClass", objectClass, Comparisons.EqualTo); }
internal PropertyComparison(Property property, Value value = null, Comparisons comparison = Comparisons.EqualTo, Query parent = null) : base(parent) { Comparison = comparison; Property = property; Value = value; }
/// <summary> /// Not equal to /// </summary> /// <param name="property">property as Property, enum or string</param> /// <param name="value">value to compare</param> /// <returns>Query</returns> public Query WhereNot(Property property, Value value) { return Where(property, value, Comparisons.NotEqualTo); }
/// <summary> /// Add an comparison for the objectCategory /// </summary> /// <param name="objectCategory">Value for the objectCategory</param> /// <returns>Query</returns> public Query WhereObjectCategoryIs(Value objectCategory) { return Where("objectCategory", objectCategory, Comparisons.EqualTo); }
/// <summary> /// Less than or equal to /// </summary> /// <param name="property">property as Property, enum or string</param> /// <param name="value">value to compare to</param> /// <returns>Query</returns> public Query WhereLte(Property property, Value value) { return Where(property, value, Comparisons.LessThanOrEqualTo); }
/// <summary> /// Greater than or equal to /// </summary> /// <param name="property">property as Property, enum or string</param> /// <param name="value">value to compare to</param> /// <returns>Query</returns> public Query WhereGte(Property property, Value value) { return Where(property, value, Comparisons.GreaterThanOrEqualTo); }
/// <summary> /// Equal to /// </summary> /// <param name="property">property as Property, enum or string</param> /// <param name="value">Value to compare</param> /// <param name="comparison">Comparisons to specify how to compare</param> /// <returns>Query</returns> public Query Where(Property property, Value value, Comparisons comparison) { var propertyEqual = new PropertyComparison(property, value, comparison, this); _elements.Add(propertyEqual); return this; }
/// <summary> /// Create a query for an user, optionally you can specify the name /// </summary> /// <param name="username">Windows username (without the domain)</param> /// <returns>Query</returns> public static Query ForUser(Value username = null) { var query = AND.WhereIsUser(); if (username != null) { query.WhereEqualTo(UserProperties.Username, username); } return query; }
/// <summary> /// Create a query for a computer, optionally you can specify the name /// </summary> /// <param name="hostname">hostname (without domain!)</param> /// <returns>Query</returns> public static Query ForComputer(Value hostname = null) { var query = AND.WhereIsComputer(); if (hostname != null) { query.WhereEqualTo(ComputerProperties.Name, hostname); } return query; }