///// <summary> ///// Create a query of the type: where key In (value1, value2, value3) ///// Works for every type of key ///// </summary> ///// <param name="keyName"></param> ///// <param name="values"></param> ///// <returns></returns> //public OrQuery In(string keyName, params object[] values) //{ // var query = new OrQuery(_typeDescription.FullTypeName); // foreach (var value in values) // { // var andQuery = new AndQuery(); // query.Elements.Add(andQuery); // var keyValue = _typeDescription.MakeKeyValue(keyName, value); // andQuery.Elements.Add(new AtomicQuery(keyValue)); // } // return query; //} ///// <summary> ///// Create a query of the type: where primary_key In (value1, value2, value3) ///// </summary> ///// <param name="values"></param> ///// <returns></returns> //public OrQuery In(params object[] values) //{ // var query = new OrQuery(_typeDescription.FullTypeName); // foreach (var value in values) // { // var andQuery = new AndQuery(); // query.Elements.Add(andQuery); // var keyValue = _typeDescription.MakePrimaryKeyValue(value); // andQuery.Elements.Add(new AtomicQuery(keyValue)); // } // return query; //} /// <summary> /// Used to search by indexed list property. Find all the objects /// </summary> /// <param name="keyName"></param> /// <param name="values"></param> /// <returns></returns> public OrQuery Contains(string keyName, params object[] values) { var keyValues = _typeDescription.MakeIndexedListKeyValues(keyName, values).ToList(); if (keyValues.Count == 0) { throw new NotSupportedException("No list index called " + keyName + " found"); } return(new OrQuery(_typeDescription.FullTypeName) { Elements = { new AndQuery { Elements = { new AtomicQuery(keyValues) } } } }); }