IMetaList<TDwo>.Exists(string name) Method
.NET Standard 2.x
Determines whether the list contains the element.
Namespace: DWNet.Data
Assembly: DWNet.Data.dll
Syntax
bool Exists(string name);
Parameters
name
System.String
The name of the element to search for.
Examples
The following code example demonstrates how to use the Exists Method.
using DWNet.Data;
using System;
namespace Appeon.ApiDoc.IMetaListExamples
{
public class ExistsExample
{
private readonly SchoolContext _context;
public ExistsExample(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 of the Columns.
var columnMetas = datastore.DwMeta.Columns;
Console.WriteLine("Columns Count: {0}", columnMetas.Count);
// Determines if a column named Departmentid exists
bool result = columnMetas.Exists("Departmentid");
Console.WriteLine("Result: {0}", result);
// Determines if a column named DepartmentName exists
result = columnMetas.Exists("DepartmentName");
Console.WriteLine("Result: {0}", result);
/*This code produces the following output:
Columns Count: 5
Result: true
Result: false
*/
}
}
}
Example Refer To
Model Class: D_Department
DataWindow File: d_department
Applies to
.NET Standard
2.x