Show / Hide Table of Contents

    IGroupMeta.By Property

    .NET Standard 2.x

    Gets and sets grouping columns.

    Namespace: DWNet.Data

    Assembly: DWNet.Data.dll

    Syntax

    List<IExpressionable<object>> By { get; set; }
    

    Return

    System.Collections.List<IExpressionable<object>>

    The grouping columns.

    Examples

    The following code example demonstrates how to use the By property.

    using DWNet.Data;
    using System;
    
    namespace Appeon.ApiDoc.IGroupMetaExamples
    {
        public class ByExample
        {
            private readonly SchoolContext _context;
    
            public ByExample(SchoolContext dataContext)
            {
                // Sets the data context
                _context = dataContext;
            }
    
            public void Example()
            {
                // Instantiates datastore with datawindow: d_department_course
                var datastore = new DataStore("d_department_course", _context);
    
                datastore.Retrieve();
    
                // Gets the properties for the Groups keyword.
                var groupMetas = datastore.DwMeta.Groups;
                Console.WriteLine("Groups Count: {0}", groupMetas.Count);
    
                foreach (var item in groupMetas)
                {
                    foreach (var byItem in item.By)
                    {
                        Console.WriteLine("By: {0}", byItem.Expression);
                    }
                }
    
                /*This code produces the following output:
                
                Groups Count: 2
                By: course_departmentid
                By: course_courseid
                */
            }
        }
    }
    

    Example Refer To

    Model Class: D_Department_Course
    DataWindow File: d_department_course

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon