/// <summary> /// </summary> /// <param name="columnNameAndValuePairs">List of pairs that look like this: /// (string name of the column, value of the column) ie. "name","John Doe" goes to entity.name = "John Doe"</param> /// <returns></returns> public QueryExpression CreateExpression(params object[] columnNameAndValuePairs) { return(QueryExpressionFactory.Create(this, columnNameAndValuePairs)); }
/// <summary> /// Gets all Entities where the columnNameAndValue Pairs match /// </summary> /// <typeparam name="T">Type of Entity List to return</typeparam> /// <param name="service"></param> /// <param name="columnSet">Columns to retrieve</param> /// <param name="columnNameAndValuePairs">List of pairs that look like this: /// (string name of the column, value of the column) ie. "name", "John Doe" </param> /// <returns></returns> public static IAsyncEnumerable <T> GetAllEntitiesAsync <T>(this IOrganizationServiceAsync2 service, ColumnSet columnSet, params object[] columnNameAndValuePairs) where T : Entity { return(service.GetAllEntitiesAsync(QueryExpressionFactory.Create <T>(columnSet, columnNameAndValuePairs))); }
/// <summary> /// Creates the expression. /// </summary> /// <returns></returns> public QueryExpression CreateExpression() { return(QueryExpressionFactory.Create(this)); }
/// <summary> /// Adds a retrieve multiple request to the current OrganizationRequestCollection. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="requests">The requests.</param> /// <param name="columnNameAndValuePairs">The column name and value pairs.</param> public static void AddRetrieveMultiple <T>(this OrganizationRequestCollection requests, params object[] columnNameAndValuePairs) where T : Entity { requests.Add(new RetrieveMultipleRequest { Query = QueryExpressionFactory.Create <T>(columnNameAndValuePairs), }); }
/// <summary> /// Gets first 5000 Active Entities (with the given subset of columns only) /// where the columnNameAndValue Pairs match /// </summary> /// <typeparam name="T">Type of Entity List to return</typeparam> /// <param name="service"></param> /// <param name="columnSet">Columns to retrieve</param> /// <param name="columnNameAndValuePairs">List of pairs that look like this: /// (string name of the column, value of the column) ie. "name", "John Doe" </param> /// <returns></returns> public static List <T> GetEntities <T>(this IOrganizationService service, ColumnSet columnSet, params object[] columnNameAndValuePairs) where T : Entity { return(service.GetEntities(QueryExpressionFactory.Create <T>(columnSet, columnNameAndValuePairs))); }
/// <summary> /// Gets first 5000 Active Entities (with the given subset of columns only) /// where the columnNameAndValue Pairs match /// </summary> /// <param name="service"></param> /// <param name="logicalName">LogicalName of the Entity.</param> /// <param name="columnSet">Columns to retrieve</param> /// <param name="columnNameAndValuePairs">List of pairs that look like this: /// (string name of the column, value of the column) ie. "name", "John Doe" </param> /// <returns></returns> public static List <Entity> GetEntities(this IOrganizationService service, string logicalName, ColumnSet columnSet, params object[] columnNameAndValuePairs) { return(service.GetEntities <Entity>(QueryExpressionFactory.Create(logicalName, columnSet, columnNameAndValuePairs))); }
public static IEnumerable <Entity> GetChildren(this Entity entity, JonasPluginBag bag, string childname, string lookupattribute, params string[] attributes) { var qx = QueryExpressionFactory.Create(childname, true, new ColumnSet(attributes), false, new object[] { lookupattribute, entity.Id }); return(bag.Service.RetrieveMultiple(qx).Entities); }