Show / Hide Table of Contents

    IMetaList<TDwo>.Remove(string name) Method

    .NET Standard 2.x

    Removes the first occurrence of the specified object from the list.

    Namespace: DWNet.Data

    Assembly: DWNet.Data.dll

    Syntax

    bool Remove(string name);
    

    Parameters

    name System.String

    The name of the element to be removed from the list.

    Examples

    The following code example demonstrates how to use the Remove method.

    using DWNet.Data;
    using System;
    
    namespace Appeon.ApiDoc.DwMetaExamples
    {
        public class RemoveExample
        {
            private readonly SchoolContext _context;
    
            public RemoveExample(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.
                IMetaList<IGroupMeta> groupMetas = datastore.DwMeta.Groups;
                Console.WriteLine("Groups Count: {0}", groupMetas.Count);
    
                // Removes the column named Departmentid.
                bool result = groupMetas.Remove("1");
                Console.WriteLine("Result: {0}", result);
    
                // Removes the column named DepartmentName.
                result = groupMetas.Remove("DepartmentName");
                Console.WriteLine("Result: {0}", result);
    
                /*This code produces the following output:
                
                Groups Count: 2
                Result: true
                Result: false
                */
            }
        }
    }
    

    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