IDataStoreBase.DwMeta Property
.NET Standard 2.x
Gets the meta data in the DataStore model.
Namespace: DWNet.Data
Assembly: DWNet.Data.dll
Syntax
IDwMeta DwMeta { get; }
Property Value
DWNet.Data.IDwMeta
The meta data in the DataStore model.
Examples
The following code example demonstrates how to use the DwMeta
property.
using DWNet.Data;
using System;
namespace Appeon.ApiDoc.IDataStoreBaseExamples
{
public class DwMetaExample
{
private readonly SchoolContext _context;
public DwMetaExample(SchoolContext dataContext)
{
// Sets the data context
_context = dataContext;
}
public void Example()
{
// Instantiates datastore with datawindow: d_department.
var datastore = new DataStore("d_department", _context);
// Gets the type of model corresponding to the current DwMeta.
var type = datastore.DwMeta.ModelType;
Console.WriteLine("ModelType Name: {0}", type.Name);
Console.WriteLine("ModelType FullName: {0}", type.FullName);
// Gets datastore columns.
var columns = datastore.DwMeta.Columns;
Console.WriteLine("Column Count: {0}", columns.Count);
foreach (var item in columns)
{
Console.WriteLine("Column ID: {0}, Column Name: {1}", item.ID, item.Name);
}
// Gets DataWindow data.
Console.WriteLine("DataWindow Processing: {0}", datastore.DwMeta.DataWindow.Processing);
Console.WriteLine("DataWindow UpdateTable: {0}", datastore.DwMeta.DataWindow.Table.UpdateTable);
Console.WriteLine("DataWindow UpdateWhere: {0}", datastore.DwMeta.DataWindow.Table.UpdateWhere);
/*This code produces the following output:
ModelType Name: D_Department
ModelType FullName: Appeon.ApiDoc.Models.D_Department
Column Count: 5
Column ID: 0, Column Name: Departmentid
Column ID: 1, Column Name: Name
Column ID: 2, Column Name: Budget
Column ID: 3, Column Name: Startdate
Column ID: 4, Column Name: Administrator
DataWindow Processing: Grid
DataWindow UpdateTable: dbo.Department
DataWindow UpdateWhere: KeyAndUpdatableColumns
*/
}
}
}
Example Refer To
Model Class: D_Department
DataWindow File: d_department