IMetaList<TDwo>.Add(TDwo item) Method
.NET Standard 2.x
Adds an object to the end of the list.
Namespace: DWNet.Data
Assembly: DWNet.Data.dll
Syntax
void Add(TDwo item);
Parameters
item
TDwo
The object to be added to the end of the list.
Examples
The following code example demonstrates how to use the Add Method.
using DWNet.Data;
using System;
namespace Appeon.ApiDoc.IMetaListExamples
{
public class AddExample
{
private readonly SchoolContext _context;
public AddExample(SchoolContext dataContext)
{
// Sets the data context
_context = dataContext;
}
public void Example()
{
// Instantiates datastore with datawindow: d_department
var datastore = new DataStore("d_department", _context);
datastore.Retrieve();
// Gets the properties for the Groups keyword.
var groupMetas = datastore.DwMeta.Groups;
Console.WriteLine("Before Add: {0}", groupMetas.Count);
// Adds a new group to the existing groups.
var groupMeta = new GroupMeta(1);
groupMeta.Name = "d_department";
groupMeta.AddGroupBy("departmentid");
groupMeta.Sort.Expression = "departmentid D";
groupMetas.Add(groupMeta);
Console.WriteLine("After Add: {0}", groupMetas.Count);
/*This code produces the following output:
Before Add: 0
After Add: 1
*/
}
}
}
Example Refer To
Model Class: D_Department
DataWindow File: d_department
Applies to
.NET Standard
2.x