/// <summary>
 /// Gets first 5000 active entities (with the given subset of columns only)
 /// where the values are in the columnName
 /// </summary>
 /// <typeparam name="T">Type of Entity List to return.</typeparam>
 /// <param name="service">The service.</param>
 /// <param name="columnSet">Columns to Return</param>
 /// <param name="columnName">The name of the column to perform the in against.</param>
 /// <param name="values">The list of values to search for being in the column name.</param>
 /// <returns></returns>
 public static List <T> GetEntitiesIn <T>(this IOrganizationService service, ColumnSet columnSet, string columnName, params object[] values) where T : Entity
 {
     return(service.RetrieveList <T>(QueryExpressionFactory.CreateIn <T>(columnSet, columnName, values)));
 }
 /// <summary>
 /// Gets first 5000 active entities where the values are in the columnName.
 /// </summary>
 /// <typeparam name="T">Type of Entity List to return.</typeparam>
 /// <param name="service">The service.</param>
 /// <param name="columnName">The name of the column to perform the in against.</param>
 /// <param name="values">The list of values to search for being in the column name.</param>
 /// <returns></returns>
 public static List <T> GetEntitiesIn <T>(this IOrganizationService service, string columnName, IEnumerable values)
     where T : Entity
 {
     return(service.RetrieveList <T>(QueryExpressionFactory.CreateIn <T>(columnName, values)));
 }
 /// <summary>
 /// Gets all active entities where the values are in the columnName.
 /// </summary>
 /// <typeparam name="T">Type of Entity List to return.</typeparam>
 /// <param name="service">The service.</param>
 /// <param name="columnName">The name of the column to perform the in against.</param>
 /// <param name="values">The list of values to search for being in the column name.</param>
 /// <returns></returns>
 public static IEnumerable <T> GetAllEntitiesIn <T>(this IOrganizationService service, string columnName, params object[] values)
     where T : Entity
 {
     return(service.RetrieveAllList <T>(QueryExpressionFactory.CreateIn <T>(columnName, values)));
 }
 /// <summary>
 /// Performs an Asynchronous delete, deleting entities that are in the given set of values
 /// Use the querySet overload if performing multiple deletes.
 /// </summary>
 /// <typeparam name="T">Type of Entity List to delete.</typeparam>
 /// <param name="service">The service.</param>
 /// <param name="columnName">The name of the column to perform the in against.</param>
 /// <param name="values">The list of values to search for being in the column name.</param>
 /// <returns></returns>
 public static BulkDeleteResult DeleteIn <T>(this IOrganizationService service, string columnName, params object[] values)
     where T : Entity
 {
     return(BulkDelete.Delete(service, new QueryExpression[] { QueryExpressionFactory.CreateIn <T>((ColumnSet)null, false, columnName, values) }));
 }
 /// <summary>
 /// Creates a query expression, containing a criteria for the specified in values
 /// </summary>
 /// <param name="columnName">The name of the column to perform the in against</param>
 /// <param name="values">The list of values to search for being in the column name</param>
 /// <returns></returns>
 public QueryExpression CreateInExpression(string columnName, params object[] values)
 {
     return(QueryExpressionFactory.CreateIn <T>(this, columnName, values));
 }
예제 #6
0
 /// <summary>
 /// Gets all Active Entities (with the given subset of columns only)
 /// where the values are in the columnName
 /// </summary>
 /// <typeparam name="T">Type of Entity List to return.</typeparam>
 /// <param name="service"></param>
 /// <param name="columnSet">Columns to Return.</param>
 /// <param name="columnName">The name of the column to perform the in against.</param>
 /// <param name="values">The list of values to search for being in the column name.</param>
 /// <returns></returns>
 public static IEnumerable <T> GetAllEntitiesIn <T>(this IOrganizationService service, ColumnSet columnSet,
                                                    string columnName, IEnumerable values) where T : Entity
 {
     return(RetrieveAllEntities <T> .GetAllEntities(service, QueryExpressionFactory.CreateIn <T>(columnSet, columnName, values)));
 }