Ejemplo n.º 1
0
		/// <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;
		}
Ejemplo n.º 3
0
		/// <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);
		}
Ejemplo n.º 4
0
		/// <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);
		}
Ejemplo n.º 5
0
		/// <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);
		}
Ejemplo n.º 6
0
		/// <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);
		}
Ejemplo n.º 7
0
		/// <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;
		}
Ejemplo n.º 8
0
		/// <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;
		}
Ejemplo n.º 9
0
		/// <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;
		}