/// <summary> /// A method used to construct CamlQueryRoot instance using specified field name and value /// with equal condition. /// </summary> /// <param name="fieldName">A parameter represents the field name.</param> /// <param name="fieldValue">A parameter represents the field value.</param> /// <returns>Returns the CamlQueryRoot instance.</returns> public static CamlQueryRoot CreateQueryRoot(string fieldName, string fieldValue) { CamlQueryRoot root = new CamlQueryRoot(); root.Where = new LogicalJoinDefinition(); LogicalTestDefinition equal = new LogicalTestDefinition(); equal.FieldRef = new FieldRefDefinitionQueryTest(); equal.FieldRef.Name = fieldName; ValueDefinition valueDef = new ValueDefinition(); valueDef.Type = "Text"; valueDef.Text = new string[] { fieldValue }; equal.Value = valueDef; root.Where.Items = new object[1]; root.Where.Items[0] = equal; root.Where.ItemsElementName = new ItemsChoiceType1[1]; root.Where.ItemsElementName[0] = ItemsChoiceType1.Eq; return root; }