### Example Usage of SelectMany Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Demonstrates how to use the SelectMany method to project nested collections like Roles and Permissions. ```csharp var permissions = users.SelectMany(typeof(Permission), "Roles.SelectMany(Permissions)"); ``` -------------------------------- ### Dynamic LINQ Query Example in C# Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/PackageReadme.md Demonstrates how to write dynamic LINQ queries using string-based syntax on an IQueryable object. This allows for runtime construction of queries based on string expressions, parameterization for safety, and dynamic selection of properties. ```csharp var query = db.Customers .Where("City == @0 and Orders.Count >= @1", "London", 10) .OrderBy("CompanyName") .Select("new(CompanyName as Name, Phone)"); ``` -------------------------------- ### Configure Queryable Analyzer Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.ParsingConfig.html Gets or sets the IQueryableAnalyzer instance used to analyze queryable expressions. ```csharp public IQueryableAnalyzer QueryableAnalyzer { get; set; } ``` -------------------------------- ### Dynamic Ordering Example (C#) Source: https://github.com/zzzprojects/system.linq.dynamic.core/wiki/Dynamic-Expressions Demonstrates how to use the OrderBy extension method with a comma-separated string to specify multiple ordering criteria. Ascending or descending order can be explicitly defined for each criterion. ```csharp products.OrderBy("Category.CategoryName, UnitPrice descending"); ``` -------------------------------- ### Interpolated String LINQ Query Example Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/README.md Shows how to use interpolated strings for dynamic LINQ queries, available in .NET 4.6+ and .NET Core 2.1+. This provides a more readable syntax for constructing dynamic queries with variables. ```csharp string cityName = "London"; int c = 10; db.Customers.WhereInterpolated($"City == {cityName} and Orders.Count >= {c}"); ``` -------------------------------- ### Perform Subsequent Ordering with Dynamic LINQ Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Demonstrates how to use the ThenBy extension method to apply secondary sorting criteria to an existing IOrderedQueryable sequence. The examples show basic property sorting, descending order, and multiple property sorting. ```csharp var result = queryable.OrderBy("LastName"); var resultSingle = result.ThenBy("NumberProperty"); var resultSingleDescending = result.ThenBy("NumberProperty DESC"); var resultMultiple = result.ThenBy("NumberProperty, StringProperty"); ``` -------------------------------- ### Set Expression Promoter in ParsingConfig Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.ParsingConfig.html Gets or sets the IExpressionPromoter implementation used for handling type promotion in dynamic expressions. ```csharp public IExpressionPromoter ExpressionPromoter { get; set; } ``` -------------------------------- ### Take Elements from Sequence Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Returns a specified number of contiguous elements from the start of an IQueryable sequence. This is a standard LINQ operation adapted for dynamic queryable sources. ```csharp public static IQueryable Take(this IQueryable source, int count) ``` -------------------------------- ### Using Open Iconic SVG Sprite Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/src-blazor/BlazorAppServer/wwwroot/css/open-iconic/README.md Explains how to utilize the Open Iconic SVG sprite for displaying icons. This approach allows all icons to be loaded with a single request, improving performance. It suggests adding classes for styling and provides examples for sizing and coloring icons using CSS. ```html ``` ```css .icon { width: 16px; height: 16px; } .icon-account-login { fill: #f00; } ``` -------------------------------- ### Substitution Values Example (C#) Source: https://github.com/zzzprojects/system.linq.dynamic.core/wiki/Dynamic-Expressions Illustrates using substitution values within a dynamic query predicate. The '@' symbol followed by an integer denotes a placeholder for values passed as parameters to the Where method, similar to parameterized queries. ```csharp customers.Where("Country = @0", country); ``` -------------------------------- ### Define ExpressionPromoter Class and Methods Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.Parser.ExpressionPromoter.html This snippet demonstrates the class definition and the signature for the Promote method used to convert expressions. It requires a ParsingConfig instance for initialization and returns a promoted Expression or null. ```csharp public class ExpressionPromoter : IExpressionPromoter { public ExpressionPromoter(ParsingConfig config) { } public virtual Expression Promote(Expression expr, Type type, bool exact, bool convertExpr) { // Implementation logic for expression promotion return null; } } ``` -------------------------------- ### Configure CustomTypeProvider in ParsingConfig Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.ParsingConfig.html Gets or sets the IDynamicLinkCustomTypeProvider used to resolve custom types during dynamic LINQ parsing. ```csharp public IDynamicLinkCustomTypeProvider CustomTypeProvider { get; set; } ``` -------------------------------- ### Initialize DefaultDynamicLinqCustomTypeProvider Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.CustomTypeProviders.DefaultDynamicLinqCustomTypeProvider.html Demonstrates the constructor for the DefaultDynamicLinqCustomTypeProvider class. Note that the boolean constructor is marked as obsolete in favor of using ParsingConfig. ```csharp [Obsolete("Please use the DefaultDynamicLinqCustomTypeProvider(ParsingConfig config, bool cacheCustomTypes = true) constructor.")] public DefaultDynamicLinqCustomTypeProvider(bool cacheCustomTypes = true) ``` -------------------------------- ### Initialize DefaultDynamicLinqCustomTypeProvider Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.CustomTypeProviders.DefaultDynamicLinqCustomTypeProvider.html Initializes a new instance of the provider with optional parsing configuration and caching settings. ```csharp public DefaultDynamicLinqCustomTypeProvider(ParsingConfig config, bool cacheCustomTypes = true) ``` -------------------------------- ### Create and Use Dynamic Class in C# Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicClassFactory.html This snippet demonstrates how to create a dynamic class with specified properties (Name and Birthday) and then instantiate it, setting the dynamic property values. It utilizes the DynamicClassFactory to create the type and DynamicClass for instantiation and property setting. No external dependencies beyond the System.Linq.Dynamic.Core library are required. ```csharp DynamicProperty[] props = new DynamicProperty[] { new DynamicProperty("Name", typeof(string)), new DynamicProperty("Birthday", typeof(DateTime)) }; Type type = DynamicClassFactory.CreateType(props); DynamicClass dynamicClass = (DynamicClass) Activator.CreateInstance(type)!; dynamicClass.SetDynamicPropertyValue("Name", "Albert"); dynamicClass.SetDynamicPropertyValue("Birthday", new DateTime(1879, 3, 14)); ``` -------------------------------- ### Queryable Property for PagedResult (C#) Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.PagedResult-1.html The Queryable property within the PagedResult class. This property allows getting and setting the underlying IQueryable that represents the data set being paginated. ```csharp public IQueryable Queryable { get; set; } ``` -------------------------------- ### Constructor: ExpressionParser Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.Parser.ExpressionParser.html Initializes a new instance of the ExpressionParser class with required parameters, expression string, values, and configuration. ```APIDOC ## Constructor: ExpressionParser ### Description Initializes a new instance of the ExpressionParser class. ### Parameters - **parameters** (ParameterExpression[]) - Required - The parameters for the expression. - **expression** (String) - Required - The string representation of the expression. - **values** (Object[]) - Required - The values used within the expression. - **parsingConfig** (ParsingConfig) - Required - The configuration settings for the parser. ### Request Example ```csharp var parser = new ExpressionParser(parameters, "it.Name == \"Test\"", values, config); ``` ``` -------------------------------- ### Define Expression Language Literals Source: https://github.com/zzzprojects/system.linq.dynamic.core/wiki/Dynamic-Expressions Examples of supported literal formats including integers, real numbers, strings, and characters. These literals are used directly within dynamic LINQ expressions. ```text 0 123 10000 1.0 2.25 10000.0 1e0 1e10 1.2345E-4 "hello" "" """quoted""" "'" 'A' '1' '''' '"' ``` -------------------------------- ### Perform Dynamic GroupBy operations in C# Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Demonstrates how to use the GroupBy extension method with string-based key and result selectors to group IQueryable data dynamically. ```csharp var groupResult1 = queryable.GroupBy("NumberPropertyAsKey", "StringProperty"); var groupResult2 = queryable.GroupBy("new (NumberPropertyAsKey, StringPropertyAsKey)", "new (StringProperty1, StringProperty2)"); ``` -------------------------------- ### Enable Custom Type Methods in Dynamic Expressions Source: https://context7.com/zzzprojects/system.linq.dynamic.core/llms.txt Shows how to expose custom static methods to the dynamic query engine using the [DynamicLinqType] attribute or by registering types via ParsingConfig. ```csharp using System.Linq.Dynamic.Core; using System.Linq.Dynamic.Core.CustomTypeProviders; [DynamicLinqType] public class StringHelper { public static string ToTitleCase(string input) => ...; } // Call static methods from annotated classes var formatted = products.Select("new (StringHelper.ToTitleCase(Name) as Name, Price)"); // Register types through ParsingConfig var config = new ParsingConfig(); config.UseDefaultDynamicLinqCustomTypeProvider( additionalTypes: new List { typeof(StringHelper) } ); var result = products.Where(config, "MathHelper.CalculateDiscount(Price, 20) > 40"); ``` -------------------------------- ### Execute Dynamic GroupBy Aggregations Source: https://context7.com/zzzprojects/system.linq.dynamic.core/llms.txt Shows how to group data using string selectors and perform projections or aggregations. Includes support for composite keys and hierarchical grouping via GroupByMany. ```csharp using System.Linq.Dynamic.Core; var products = new List { new Product { Id = 1, Name = "Laptop", Price = 999.99m, Category = "Electronics" }, new Product { Id = 2, Name = "Mouse", Price = 29.99m, Category = "Electronics" }, new Product { Id = 3, Name = "Desk", Price = 199.99m, Category = "Furniture" }, new Product { Id = 4, Name = "Chair", Price = 149.99m, Category = "Furniture" } }.AsQueryable(); var byCategory = products.GroupBy("Category"); var categoryStats = products.GroupBy("Category", "new (Key as Category, Count() as ProductCount)"); var compositeGroup = products.GroupBy("new (Category, Price > 100 as IsExpensive)"); var aggregated = products.GroupBy("Category", "new (Key, Sum(Price) as TotalPrice, Average(Price) as AvgPrice)"); var nestedGroups = products.GroupByMany("Category", "Price > 500"); ``` -------------------------------- ### Get Dynamic Property Value (C#) Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicClass.html Retrieves the value of a dynamic property by its name. This method is part of the DynamicClass and is used to access properties that are not statically defined. It takes the property name as a string and returns the property's value as an object. ```csharp public object GetDynamicPropertyValue(string propertyName) ``` -------------------------------- ### Perform Dynamic Sorting with OrderBy Source: https://context7.com/zzzprojects/system.linq.dynamic.core/llms.txt Demonstrates how to sort IQueryable sequences using string expressions. Supports ascending and descending orders, multiple sort keys, and integration with ThenBy. ```csharp using System.Linq.Dynamic.Core; var products = new List { new Product { Id = 1, Name = "Laptop", Price = 999.99m, Category = "Electronics" }, new Product { Id = 2, Name = "Mouse", Price = 29.99m, Category = "Electronics" }, new Product { Id = 3, Name = "Desk", Price = 199.99m, Category = "Furniture" } }.AsQueryable(); var byName = products.OrderBy("Name"); var byPriceDesc = products.OrderBy("Price descending"); var multiSort = products.OrderBy("Category, Price descending"); var orderedQuery = products.OrderBy("Category").ThenBy("Price desc"); string sortColumn = "Price"; string sortDirection = "desc"; var dynamicSort = products.OrderBy($"{sortColumn} {sortDirection}"); ``` -------------------------------- ### Get Typed Dynamic Property Value (C#) Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicClass.html Retrieves the value of a dynamic property by its name, with a specified return type. This generic method allows for type-safe retrieval of dynamic property values. It takes the property name as a string and returns the value cast to the generic type T. ```csharp public T GetDynamicPropertyValue(string propertyName) ``` -------------------------------- ### Access Default ParsingConfig Instances Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.ParsingConfig.html Provides access to static default configurations for general use, Cosmos DB, and Entity Framework Core 2.1+. ```csharp public static ParsingConfig Default { get; } public static ParsingConfig DefaultCosmosDb { get; } public static ParsingConfig DefaultEFCore21 { get; } ``` -------------------------------- ### Paging Support with System.Linq.Dynamic.Core Source: https://context7.com/zzzprojects/system.linq.dynamic.core/llms.txt System.Linq.Dynamic.Core offers `Page` and `PageResult` for efficient data pagination. `PageResult` includes metadata like current page, page count, and total row count, with an option for pre-computed row counts. ```csharp using System.Linq.Dynamic.Core; var products = Enumerable.Range(1, 100) .Select(i => new Product { Id = i, Name = $"Product {i}", Price = i * 10m }) .AsQueryable(); // Simple paging - get page 2 with 10 items per page var page2 = products.Page(page: 2, pageSize: 10); // Result: Products 11-20 // Skip and Take (traditional approach) var skipped = products.Skip(20).Take(10); // Result: Products 21-30 // PageResult - returns data with metadata var pageResult = products.OrderBy("Price desc").PageResult(page: 1, pageSize: 10); Console.WriteLine($"Current Page: {pageResult.CurrentPage}"); // 1 Console.WriteLine($"Page Count: {pageResult.PageCount}"); // 10 Console.WriteLine($"Page Size: {pageResult.PageSize}"); // 10 Console.WriteLine($"Row Count: {pageResult.RowCount}"); // 100 foreach (var item in pageResult.Queryable) { Console.WriteLine($"{item.Name}: ${item.Price}"); } // PageResult with pre-computed row count (more efficient) int totalCount = 100; // From cache or separate query var efficientPage = products.PageResult(page: 3, pageSize: 10, rowCount: totalCount); ``` -------------------------------- ### Get Assembly Types with DynamicLinqTypeAttribute (C#) Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.CustomTypeProviders.AbstractDynamicLinqCustomTypeProvider.html This protected method retrieves all types from a given set of assemblies that are annotated with the DynamicLinqTypeAttribute. It's designed to handle exceptions gracefully during the type retrieval process. The method accepts an enumerable collection of System.Reflection.Assembly objects and returns an array of System.Type objects. ```csharp protected Type[] GetAssemblyTypesWithDynamicLinqTypeAttribute(IEnumerable assemblies) ``` -------------------------------- ### Retrieve Custom Types and Extension Methods Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.CustomTypeProviders.DefaultDynamicLinqCustomTypeProvider.html Methods to fetch the collection of custom types and extension methods recognized by the dynamic LINQ engine. ```csharp public virtual HashSet GetCustomTypes(); public Dictionary> GetExtensionMethods(); ``` -------------------------------- ### Styling Open Iconic Icons with CSS Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/src-blazor/BlazorWASMExample/wwwroot/css/open-iconic/README.md Provides CSS examples for sizing and coloring icons when using the Open Iconic SVG sprite. Icons are square, so setting equal width and height on the SVG element controls the size. The 'fill' property on the 'use' tag controls the icon color. ```css .icon { width: 16px; height: 16px; } .icon-account-login { fill: #f00; } ``` -------------------------------- ### Dynamic GroupBy with String Selectors Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Demonstrates how to use the GroupBy extension method to group an IQueryable sequence based on string-based property expressions. ```csharp var groupResult1 = queryable.GroupBy("NumberPropertyAsKey"); var groupResult2 = queryable.GroupBy("new (NumberPropertyAsKey, StringPropertyAsKey)"); ``` -------------------------------- ### Data Object Initializer in C# Source: https://github.com/zzzprojects/system.linq.dynamic.core/wiki/Dynamic-Expressions Illustrates creating a dynamic data object with inferred properties using System.Linq.Dynamic.Core. The 'new' keyword is used to define the structure and initialize properties from existing data. ```csharp customers.Select("new(CompanyName as Name, Phone)"); ``` -------------------------------- ### Dynamic Sorting with OrderBy in C# Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Demonstrates how to use the OrderBy extension method to sort IQueryable sequences dynamically. Supports single property sorting, descending order, and multi-property sorting via string expressions. ```csharp var resultSingle = queryable.OrderBy("NumberProperty"); var resultSingleDescending = queryable.OrderBy("NumberProperty DESC"); var resultMultiple = queryable.OrderBy("NumberProperty, StringProperty DESC"); ``` -------------------------------- ### Accessing Android Assets with AssetManager Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/test-xamarin/TestSLDC.Android/Assets/AboutAssets.txt Demonstrates how to open a raw asset file from the Android assets directory using the AssetManager. This approach requires the file to be marked with a Build Action of 'AndroidAsset' in the project settings. ```csharp public class ReadAsset : Activity { protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); InputStream input = Assets.Open ("my_asset.txt"); } } ``` ```csharp Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); ``` -------------------------------- ### Configure ParsingConfig for Object Comparison Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.ParsingConfig.html Demonstrates how to enable the ConvertObjectToSupportComparison property to allow comparison operations on properties defined as type object. ```csharp class Person { public string Name { get; set; } public object Age { get; set; } } var persons = new[] { new Person { Name = "Foo", Age = 99 }, new Person { Name = "Bar", Age = 33 } }.AsQueryable(); var config = new ParsingConfig { ConvertObjectToSupportComparison = true }; var results = persons.Where(config, "Age > 50").ToList(); ``` -------------------------------- ### Using Open Iconic Icon Font Standalone Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/src-blazor/BlazorAppServer/wwwroot/css/open-iconic/README.md Explains the standalone usage of Open Iconic icon fonts without a specific framework. This includes linking the default stylesheet and using the `data-glyph` attribute for icon selection, offering flexibility for custom implementations. ```html ``` -------------------------------- ### Create Dynamic Data Classes with DynamicExpression Source: https://github.com/zzzprojects/system.linq.dynamic.core/wiki/Dynamic-Expressions Demonstrates how to define properties using DynamicProperty and generate a new data class type at runtime. The resulting type can be instantiated via reflection to create objects with dynamic schemas. ```csharp DynamicProperty[] props = new DynamicProperty[] { new DynamicProperty("Name", typeof(string)), new DynamicProperty("Birthday", typeof(DateTime)) }; Type type = DynamicExpression.CreateClass(props); object obj = Activator.CreateInstance(type); type.GetProperty("Name").SetValue(obj, "Albert", null); type.GetProperty("Birthday").SetValue(obj, new DateTime(1879, 3, 14), null); Console.WriteLine(obj); ``` -------------------------------- ### Using Open Iconic Icon Font with Foundation Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/src-blazor/BlazorAppServer/wwwroot/css/open-iconic/README.md Details how to use Open Iconic icon fonts within projects utilizing the Foundation framework. It shows the required stylesheet link for Foundation and the HTML structure for icon implementation using Foundation's specific classes. ```html ``` -------------------------------- ### Dynamic Paging with Page in C# Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Shows how to retrieve a specific page of elements from an IQueryable collection using the Page extension method. Requires the System.Linq.Dynamic.Core library. Takes the current page number and the number of items per page as input. ```csharp var pagedResults = queryable.Page(pageNumber, pageSize); ``` -------------------------------- ### Define and Initialize DynamicProperty in C# Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicProperty.html This snippet demonstrates the declaration of the DynamicProperty class and its constructor, which requires a string name and a Type object. It is used to define the schema for dynamic objects. ```csharp public class DynamicProperty { public string Name { get; } public Type Type { get; } public DynamicProperty(string name, Type type) { Name = name; Type = type; } } ``` -------------------------------- ### Compute Max values using dynamic string predicates Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Demonstrates how to use the Max extension method with string-based selectors to find the maximum value within an IQueryable sequence. This approach supports dynamic property access and parameter injection. ```csharp IQueryable queryable = employees.AsQueryable(); var result1 = queryable.Max(); var result2 = queryable.Select("Roles.Max()"); var result3 = queryable.Max("Income"); ``` -------------------------------- ### Parsing Lambda Expressions Source: https://github.com/zzzprojects/system.linq.dynamic.core/wiki/Dynamic-Expressions Shows how to use DynamicExpressionParser to create lambda expressions from strings, supporting parameter binding and explicit result type casting. ```csharp ParameterExpression x = Expression.Parameter(typeof(int), "x"); ParameterExpression y = Expression.Parameter(typeof(int), "y"); LambdaExpression e = DynamicExpressionParser.ParseLambda(new ParameterExpression[] { x, y }, null, "(x + y) * 2"); ``` -------------------------------- ### Dynamic OrderBy for IQueryable Collections Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Allows dynamic ordering of IQueryable collections using a string expression. Supports single or multiple properties, and ascending/descending order. Requires the System.Linq.Dynamic.Core library. ```csharp var result = queryable.OrderBy("LastName"); var resultSingle = result.OrderBy("NumberProperty"); var resultSingleDescending = result.OrderBy("NumberProperty DESC"); var resultMultiple = result.OrderBy("NumberProperty, StringProperty DESC"); ``` -------------------------------- ### Using Open Iconic SVGs Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/src-blazor/BlazorAppServer/wwwroot/css/open-iconic/README.md Demonstrates how to use individual SVG files from the Open Iconic set. This method involves referencing the SVG file directly in an `` tag, ensuring accessibility with an `alt` attribute. ```html icon name ``` -------------------------------- ### Dynamic Join with ParsingConfig Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Performs an inner join on two sequences (IQueryable and IEnumerable) using dynamic string-based key selectors and a result selector, with an explicit ParsingConfig. Supports optional arguments for parameterization. Requires System.Linq.Dynamic.Core. ```csharp public static IQueryable Join(this IQueryable outer, ParsingConfig config, IEnumerable inner, string outerKeySelector, string innerKeySelector, string resultSelector, params object[] args) ``` -------------------------------- ### Select with ParsingConfig and String Selector Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html The Select extension method projects each element of a sequence into a new form using a provided selector string and optional arguments. It requires an IQueryable source, a ParsingConfig, the selector string, and an array of objects for parameters. This method is useful for dynamic data shaping. ```csharp public static IQueryable Select(this IQueryable source, ParsingConfig config, string selector, params object[] args) { // Implementation details for dynamic selection throw new System.NotImplementedException(); } ``` -------------------------------- ### METHOD Page Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Returns a subset of the IQueryable collection based on page number and page size. ```APIDOC ## [METHOD] Page ### Description Returns the elements of an IQueryable as a paged result set. ### Method C# Extension Method ### Parameters - **source** (IQueryable) - Required - The IQueryable to return elements from. - **page** (Int32) - Required - The page number to return. - **pageSize** (Int32) - Required - The number of elements per page. ### Response - **Returns** (IQueryable) - A System.Linq.IQueryable that contains the paged elements. ``` -------------------------------- ### All(IQueryable, string, params object[]) Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Tests if every element in a sequence satisfies a given dynamic predicate. ```APIDOC ## POST /All ### Description Determines whether all elements of a sequence satisfy a condition defined by a dynamic string predicate. ### Method POST ### Parameters #### Request Body - **source** (IQueryable) - Required - The sequence to test. - **predicate** (string) - Required - The dynamic string expression to test each element. - **args** (object[]) - Optional - Parameters to inject into the predicate string. ### Response #### Success Response (200) - **result** (bool) - Returns true if all elements pass the test or if the sequence is empty. ### Response Example { "result": true } ``` -------------------------------- ### Accessing Android Assets via AssetManager Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/test-xamarin/ExpressionSample/ExpressionSample.Android/Assets/AboutAssets.txt Demonstrates how to open a raw asset file using the Android AssetManager within an Activity. This requires the file to be marked with the 'AndroidAsset' build action. ```csharp public class ReadAsset : Activity { protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); InputStream input = Assets.Open ("my_asset.txt"); } } ``` -------------------------------- ### Configure Enumeration Support in System Namespace Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.ParsingConfig.html Controls whether enumeration types from the System namespace (e.g., StringComparison) are supported in dynamic queries. Defaults to true. ```csharp public bool SupportEnumerationsFromSystemNamespace { get; set; } ``` -------------------------------- ### ThenBy Method Declarations Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Method signatures for the ThenBy extension methods, showing the supported overloads including ParsingConfig and IComparer parameters. ```csharp public static IOrderedQueryable ThenBy(this IOrderedQueryable source, ParsingConfig config, string ordering, params object[] args); public static IOrderedQueryable ThenBy(this IOrderedQueryable source, string ordering, IComparer comparer, params object[] args); ``` -------------------------------- ### Compute Min values from IQueryable Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Shows the basic usage of the Min extension method to retrieve the minimum element from a sequence. This method operates directly on an IQueryable source. ```csharp IQueryable queryable = employees.AsQueryable(); var minResult = queryable.Min(); ``` -------------------------------- ### Resolve Type by Name Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.CustomTypeProviders.DefaultDynamicLinqCustomTypeProvider.html Resolves a type based on its full name within the current application domain. ```csharp public Type ResolveType(string typeName) ``` -------------------------------- ### Perform Basic Dynamic SelectMany Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html A simplified version of SelectMany that projects elements to an IQueryable and flattens them using a string selector and optional arguments. ```csharp public static IQueryable SelectMany(this IQueryable source, string selector, params object[] args) ``` -------------------------------- ### GroupBy Method Signatures Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Provides the method signatures for the GroupBy extensions, including support for ParsingConfig, custom equality comparers, and parameter arrays for dynamic formatting. ```csharp public static IQueryable GroupBy(this IQueryable source, ParsingConfig config, string keySelector, string resultSelector, IEqualityComparer equalityComparer); public static IQueryable GroupBy(this IQueryable source, ParsingConfig config, string keySelector, string resultSelector, IEqualityComparer equalityComparer, object[] args); ``` -------------------------------- ### IDynamicLinqCustomTypeProvider Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.CustomTypeProviders.IDynamicLinqCustomTypeProvider.html Provides functionality to resolve System.Type instances dynamically within the System.Linq.Dynamic.Core library. ```APIDOC ## IDynamicLinqCustomTypeProvider ### Description Provides functionality to resolve System.Type instances dynamically. This is crucial for enabling dynamic LINQ queries that reference custom types. ### Method Not Applicable (Interface Definition) ### Endpoint Not Applicable (Interface Definition) ### Parameters This interface does not define direct parameters for an endpoint. Its methods would accept parameters relevant to type resolution. ### Request Example Not Applicable (Interface Definition) ### Response #### Success Response (Interface Method Return) - **System.Type** (Type) - A resolved System.Type or null when not found. #### Response Example ```json { "resolvedType": "System.String" } ``` *Note: The actual return type is System.Type, the example above illustrates a potential resolved type.* ``` -------------------------------- ### Add Custom Type Converters Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.ParsingConfig.html Allows the addition of custom type converters to handle specific type conversions within dynamic queries. This is useful for extending the default conversion capabilities. ```csharp public IDictionary TypeConverters { get; set; } ``` -------------------------------- ### GroupBy with ParsingConfig, Key Selector, Result Selector, and Arguments (C#) Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Groups elements of an IQueryable based on a key selector string and projects results using a result selector string. It supports dynamic parameters for the selectors. This method is part of the System.Linq.Dynamic.Core library. ```csharp public static IQueryable GroupBy(this IQueryable source, ParsingConfig config, string keySelector, string resultSelector, params object[] args) { // Implementation details... return null; // Placeholder } // Example Usage: // var groupResult1 = queryable.GroupBy("NumberPropertyAsKey", "StringProperty"); // var groupResult2 = queryable.GroupBy("new (NumberPropertyAsKey, StringPropertyAsKey)", "new (StringProperty1, StringProperty2)"); ``` -------------------------------- ### Generic Dynamic Select with ParsingConfig (C#) Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Projects each element of a sequence into a new object of a generic type TResult, with customizable parsing configuration. This method offers more control over the parsing process via the ParsingConfig object. It takes the source IQueryable, a ParsingConfig, a selector string, and optional arguments. ```csharp public static IQueryable Select(this IQueryable source, ParsingConfig config, string selector, params object[] args) ``` -------------------------------- ### Using Open Iconic Icon Font with Bootstrap Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/src-blazor/BlazorAppServer/wwwroot/css/open-iconic/README.md Provides instructions for integrating Open Iconic icon fonts with Bootstrap projects. It includes the necessary `` tag for the Bootstrap stylesheet and the `` tag structure for displaying icons using Bootstrap's class conventions. ```html ``` -------------------------------- ### Select with ParsingConfig, Type, and String Selector Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html This overload of the Select extension method projects each element of a sequence into a new class of a specified result type. It takes an IQueryable source, a ParsingConfig, the target result Type, a selector string, and optional arguments. Refer to http://solutionizing.net/category/linq/ for more details. ```csharp public static IQueryable Select(this IQueryable source, ParsingConfig config, Type resultType, string selector, params object[] args) { // Implementation details for dynamic selection into a specific type throw new System.NotImplementedException(); } ``` -------------------------------- ### Dynamic Select Projection with System.Linq.Dynamic.Core Source: https://context7.com/zzzprojects/system.linq.dynamic.core/llms.txt Projects elements into new forms using string expressions, supporting property selection, anonymous type creation, and computed values. This allows for flexible data shaping at runtime. ```csharp using System.Linq.Dynamic.Core; var products = new List { new Product { Id = 1, Name = "Laptop", Price = 999.99m, Category = "Electronics" }, new Product { Id = 2, Name = "Mouse", Price = 29.99m, Category = "Electronics" }, new Product { Id = 3, Name = "Desk", Price = 199.99m, Category = "Furniture" } }.AsQueryable(); // Select single property var names = products.Select("Name"); // Result: ["Laptop", "Mouse", "Desk"] // Create dynamic object with multiple properties var projections = products.Select("new (Name, Price)"); // Result: [{ Name = "Laptop", Price = 999.99 }, ...] // Rename properties using 'as' keyword var renamed = products.Select("new (Name as ProductName, Price as Cost)"); // Result: [{ ProductName = "Laptop", Cost = 999.99 }, ...] // Computed values in projection var computed = products.Select("new (Name, Price * 1.1 as PriceWithTax)"); // Result: [{ Name = "Laptop", PriceWithTax = 1099.989 }, ...] // Select into strongly-typed result public class ProductDto { public string Name { get; set; } public decimal Price { get; set; } } var typedResult = products.Select("new (Name, Price)").ToList(); // Result: List with mapped values ``` -------------------------------- ### Loading Fonts from Assets Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/test-xamarin/ExpressionSample/ExpressionSample.Android/Assets/AboutAssets.txt Shows how to load a custom typeface directly from the assets directory using the Typeface class. This is a common pattern for applying custom fonts in Android applications. ```csharp Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); ``` -------------------------------- ### ThenBy API (with IComparer) Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Provides the ThenBy method for IOrderedQueryable, which performs a subsequent ordering of elements in ascending order according to a key, using an IComparer. ```APIDOC ## ThenBy(IOrderedQueryable, ParsingConfig, String, IComparer, Object[]) ### Description Performs a subsequent ordering of the elements in a sequence in ascending order according to a key. ### Method GET (or relevant HTTP method if this were a web API) ### Endpoint N/A (This is a library method, not a web endpoint) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```csharp // Assuming 'orderedQueryable' is an IOrderedQueryable and 'comparer' is an IComparer instance var result = orderedQueryable.ThenBy(config, "PropertyName", comparer, args); ``` ### Response #### Success Response (200) Type: System.Linq.IOrderedQueryable Description: A System.Linq.IQueryable whose elements are sorted according to the specified `ordering`. #### Response Example (Conceptual - actual return type is IOrderedQueryable) ```json { "example": "[ordered elements]" } ``` ``` -------------------------------- ### Parse and Compile Lambda Expressions Source: https://context7.com/zzzprojects/system.linq.dynamic.core/llms.txt Explains the use of DynamicExpressionParser to convert string-based logic into executable LambdaExpression objects. Useful for dynamic filtering, projection, and combining complex predicates. ```csharp using System.Linq.Dynamic.Core; using System.Linq.Expressions; var lambda = DynamicExpressionParser.ParseLambda(ParsingConfig.Default, false, "Price > 100"); Func compiled = lambda.Compile(); var paramLambda = DynamicExpressionParser.ParseLambda(ParsingConfig.Default, false, "Price > @0 and Category == @1", 100m, "Electronics"); var x = Expression.Parameter(typeof(int), "x"); var y = Expression.Parameter(typeof(int), "y"); var mathLambda = DynamicExpressionParser.ParseLambda(new[] { x, y }, typeof(int), "(x + y) * 2"); var selectorLambda = DynamicExpressionParser.ParseLambda(ParsingConfig.Default, true, typeof(Product), null, "new (Name, Price)"); var e1 = DynamicExpressionParser.ParseLambda(ParsingConfig.Default, true, "Category == \"Electronics\""); var e2 = DynamicExpressionParser.ParseLambda(ParsingConfig.Default, true, "Price > 50"); var combined = products.Where("@0(it) and @1(it)", e1, e2); ``` -------------------------------- ### Tuple Class Overview Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Tuple-2.html Provides information about the Tuple class, its inheritance, namespace, assembly, and syntax. ```APIDOC ## Class Tuple ### Description Represents a 2-tuple, or pair. ### Inheritance System.Object Tuple ### Namespace System ### Assembly System.Linq.Dynamic.Core.dll ### Syntax ```csharp public class Tuple ``` ### Type Parameters * **T1**: The type of the tuple's first component. * **T2**: The type of the tuple's second component. ``` -------------------------------- ### Generic Dynamic ThenBy with ParsingConfig Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Provides a generic overload for subsequent ordering with a ParsingConfig, allowing custom parsing behavior. Supports specifying the ordering string, an optional comparer, and parameters. Requires the System.Linq.Dynamic.Core library. ```csharp public static IOrderedQueryable ThenBy(this IOrderedQueryable source, ParsingConfig config, string ordering, IComparer comparer, params object[] args) ``` -------------------------------- ### ParsingConfig Configuration Properties Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.ParsingConfig.html A collection of configuration properties used to define the behavior of the Dynamic LINQ parser. ```APIDOC ## PROPERTY LoadAdditionalAssembliesFromCurrentDomainBaseDirectory ### Description Determines whether to load additional assemblies from the current domain base directory. Applicable for full .NET Framework and .NET Core 2.x and higher. ### Type System.Boolean ### Default Value false --- ## PROPERTY NullPropagatingUseDefaultValueForNonNullableValueTypes ### Description When using the NullPropagating function np(...), this setting determines if a default value should be used for non-nullable value types instead of null. ### Type System.Boolean ### Default Value false --- ## PROPERTY NumberParseCulture ### Description Defines the culture used for number parsing operations. ### Type System.Globalization.CultureInfo ### Default Value CultureInfo.InvariantCulture --- ## PROPERTY PrioritizePropertyOrFieldOverTheType ### Description When set to true, the parser prioritizes properties or fields over types when names collide. This also affects extension method resolution. ### Type System.Boolean ### Default Value true --- ## PROPERTY QueryableAnalyzer ### Description Gets or sets the IQueryableAnalyzer instance used for analyzing queryable expressions. ### Type IQueryableAnalyzer --- ## PROPERTY RenameEmptyParameterExpressionNames ### Description If enabled, prevents empty ParameterExpression names by substituting them with a random 16-character string. ### Type System.Boolean ### Default Value false ``` -------------------------------- ### Dynamic Join with IQueryable and IEnumerable Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Performs an inner join on two sequences (IQueryable and IEnumerable) using dynamic string-based key selectors and a result selector. Supports optional arguments for parameterization. Requires System.Linq.Dynamic.Core. ```csharp public static IQueryable Join(this IQueryable outer, IEnumerable inner, string outerKeySelector, string innerKeySelector, string resultSelector, params object[] args) ``` -------------------------------- ### Compute Sum of Numeric Sequences using Dynamic LINQ Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Demonstrates how to calculate the sum of numeric values from an IQueryable source. Supports both direct summation and property-based summation using string predicates. ```csharp IQueryable queryable = employees.AsQueryable(); var result1 = queryable.Sum(); var result2 = queryable.Select("Roles.Sum()"); var result3 = queryable.Sum("Income"); ``` -------------------------------- ### First(IQueryable, String, Object[]) Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Returns the first element of a sequence that satisfies a specified condition using a predicate string and arguments. ```APIDOC ## GET /api/iqueryable/first-predicate ### Description Returns the first element of a sequence that satisfies a specified condition using a predicate string and arguments. ### Method GET ### Endpoint /api/iqueryable/first-predicate ### Parameters #### Query Parameters - **source** (IQueryable) - Required - The System.Linq.IQueryable to return the first element of. - **predicate** (String) - Required - A function to test each element for a condition. - **args** (Object[]) - Optional - An object array that contains zero or more objects to insert into the predicate as parameters. Similar to the way String.Format formats strings. ### Response #### Success Response (200) - **result** (object) - The first element in source that passes the test in predicate. #### Response Example ```json { "result": "someValue" } ``` ``` -------------------------------- ### ExtensibilityPoint.QueryOptimizer Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.ExtensibilityPoint.html The QueryOptimizer field is a static Func delegate that allows you to inject custom query optimization logic before queries are executed. You can set this field to override the default behavior with your own implementation, such as using the Linq.Expression.Optimizer NuGet package. ```APIDOC ## ExtensibilityPoint.QueryOptimizer ### Description Place to optimize your queries. Example: Add a reference to Nuget package Linq.Expression.Optimizer and in your program initializers set Extensibility.QueryOptimizer = ExpressionOptimizer.visit; ### Method N/A (Static Field) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (N/A) - **QueryOptimizer** (System.Func) - A delegate that takes an Expression and returns a modified Expression, used for query optimization. #### Response Example N/A ``` -------------------------------- ### Filter IQueryable using string predicates Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Demonstrates how to use the Where extension method to filter an IQueryable sequence using string-based predicates. Supports both direct string expressions and parameterized queries similar to String.Format. ```csharp var result1 = queryable.Where("NumberProperty = 1"); var result2 = queryable.Where("NumberProperty = @0", 1); var result3 = queryable.Where("StringProperty = null"); var result4 = queryable.Where("StringProperty = \"abc\""); var result5 = queryable.Where("StringProperty = @0", "abc"); ``` -------------------------------- ### Min(IQueryable) Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Computes the minimum element of a sequence. ```APIDOC ## METHOD Min(IQueryable) ### Description Computes the min element of a sequence. ### Method STATIC EXTENSION ### Parameters #### Path Parameters - **source** (IQueryable) - Required - A sequence of values to calculate find the min for. ### Response #### Success Response (200) - **result** (Object) - The min element in the sequence. ``` -------------------------------- ### Dynamic ThenBy for IOrderedQueryable Collections Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Performs a subsequent ordering on an already ordered IQueryable collection. Supports specifying the ordering string, an optional comparer, and parameters. Requires the System.Linq.Dynamic.Core library. ```csharp public static IOrderedQueryable ThenBy(this IOrderedQueryable source, string ordering, IComparer comparer, params object[] args) public static IOrderedQueryable ThenBy(this IOrderedQueryable source, string ordering, params object[] args) ``` -------------------------------- ### Perform Dynamic SelectMany Projection Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Projects each element of a sequence to an IQueryable and flattens the result. It accepts a string-based selector and optional arguments for parameter substitution. ```csharp var permissions = users.SelectMany("Roles.SelectMany(Permissions)"); public static IQueryable SelectMany(this IQueryable source, string selector, params object[] args) ``` -------------------------------- ### Join IQueryable with ParsingConfig and Dynamic Selectors Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Performs an inner join operation on two IQueryable sequences using dynamic key selectors and a result selector, with support for ParsingConfig and parameterized queries. ```csharp public static IQueryable Join(this IQueryable outer, ParsingConfig config, IEnumerable inner, string outerKeySelector, string innerKeySelector, string resultSelector, params object[] args) ``` -------------------------------- ### Dynamic Lambda Invocation in C# Source: https://github.com/zzzprojects/system.linq.dynamic.core/wiki/Dynamic-Expressions Demonstrates combining pre-parsed dynamic lambda expressions into a larger query using System.Linq.Dynamic.Core. This allows for modular and reusable query logic. ```csharp Expression> e1 = DynamicExpressionParser.ParseLambda(ParsingConfig.Default, true, "City = \"London\""); Expression> e2 = DynamicExpressionParser.ParseLambda(ParsingConfig.Default, true, "Orders.Count >= 10"); IQueryable query = db.Customers.Where("@0(it) and @1(it)", e1, e2); ``` ```csharp Expression> e1 = c => c.City == "London"; Expression> e2 = DynamicExpressionParser.ParseLambda(ParsingConfig.Default, true, "Orders.Count >= 10"); IQueryable query = db.Customers.Where("@0(it) and @1(it)", e1, e2); ``` ```csharp IQueryable query = db.Customers.Where(c => c.City == "London" && c.Orders.Count >= 10); ``` -------------------------------- ### OrderBy Method Signatures Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html The various overloads for the OrderBy method, allowing for flexible configuration including custom ParsingConfig, IComparer, and parameter arguments. ```csharp public static IOrderedQueryable OrderBy(this IQueryable source, ParsingConfig config, string ordering, IComparer comparer, params object[] args) public static IOrderedQueryable OrderBy(this IQueryable source, ParsingConfig config, string ordering, params object[] args) public static IOrderedQueryable OrderBy(this IQueryable source, string ordering, IComparer comparer, params object[] args) public static IOrderedQueryable OrderBy(this IQueryable source, string ordering, params object[] args) ``` -------------------------------- ### Dynamically Aggregate Data with IQueryable Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Executes a specified aggregate function (Sum, Average, Min, Max) on a given property of an IQueryable data source. This method is useful for performing calculations on data when the aggregation logic is determined dynamically at runtime. ```csharp public static object Aggregate(this IQueryable source, string function, string member) ``` -------------------------------- ### Using Open Iconic SVG Sprite Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/src-blazor/BlazorWASMExample/wwwroot/css/open-iconic/README.md Illustrates how to utilize the Open Iconic SVG sprite for displaying icons with a single request. This method is efficient and comparable to icon fonts. It suggests adding general and specific classes for styling flexibility. ```html ``` -------------------------------- ### POST /ParseLambda (Full Configuration) Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicExpressionParser.html Parses an expression into a LambdaExpression using a specific ParsingConfig and type definitions. ```APIDOC ## POST /ParseLambda ### Description Parses an expression into a LambdaExpression with full configuration support. Note: This does not work for Linq-to-Database entities. ### Method POST ### Endpoint /ParseLambda ### Parameters #### Request Body - **delegateType** (Type) - Required - The delegate type. - **parsingConfig** (ParsingConfig) - Required - The Configuration for the parsing. - **itType** (Type) - Required - The main type from the dynamic class expression. - **resultType** (Type) - Optional - Type of the result. If not specified, it will be generated dynamically. - **expression** (String) - Required - The expression string. - **values** (Object[]) - Optional - An object array containing replacement values. ### Response #### Success Response (200) - **LambdaExpression** (Object) - The generated System.Linq.Expressions.LambdaExpression ``` -------------------------------- ### SelectMany with Generic Result Type and ParsingConfig (C#) Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Projects each element of a sequence to an IQueryable and combines the resulting sequences into one sequence. This generic overload utilizes a ParsingConfig for more advanced parsing scenarios and accepts a selector string with optional arguments. ```csharp public static IQueryable SelectMany(this IQueryable source, ParsingConfig config, string selector, params object[] args) ``` -------------------------------- ### SelectMany with String Selectors and Parameter Names (C#) Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.DynamicQueryableExtensions.html Projects each element of a sequence to an IQueryable and invokes a result selector function on each element therein. The resulting values from each intermediate sequence are combined into a single, one-dimensional sequence and returned. This overload allows specifying parameter names for the selectors. ```csharp public static IQueryable SelectMany(this IQueryable source, ParsingConfig config, string collectionSelector, string resultSelector, string collectionParameterName, string resultParameterName, object[] collectionSelectorArgs = null, params object[] resultSelectorArgs) ``` -------------------------------- ### DynamicQueryable Extension Methods Source: https://github.com/zzzprojects/system.linq.dynamic.core/wiki/Dynamic-Expressions Core methods for performing dynamic LINQ operations on IQueryable objects. ```APIDOC ## [METHOD] DynamicQueryable Extensions ### Description These methods allow for dynamic querying of IQueryable sources using string-based predicates, selectors, and orderings. ### Methods - **Where**(string predicate, params object[] values) - **Select**(string selector, params object[] values) - **OrderBy**(string ordering, params object[] values) - **Take**(int count) - **Skip**(int count) - **GroupBy**(string keySelector, string elementSelector, params object[] values) - **Any**() - **Count**() ### Parameters - **predicate/selector/ordering** (string) - Required - A string expression defining the operation logic. - **values** (object[]) - Optional - Substitution values for the expression (referenced as @0, @1, etc.). - **count** (int) - Required - The number of elements to take or skip. ### Request Example products.OrderBy("Category.CategoryName, UnitPrice descending"); ### Response - **IQueryable** - The resulting queryable object after applying the dynamic operation. ``` -------------------------------- ### Enable Parameterized Names in Dynamic Queries Source: https://github.com/zzzprojects/system.linq.dynamic.core/blob/master/docs/api/System.Linq.Dynamic.Core.ParsingConfig.html Determines whether parameterized names are used in generated dynamic SQL queries. Enabling this can improve security and performance by preventing SQL injection and allowing query plan reuse. Defaults to false. ```csharp public bool UseParameterizedNamesInDynamicQuery { get; set; } ```