IExportXmlMeta.Templates Property
.NET Standard 2.x
Gets all of the templates in the model.
Namespace: DWNet.Data
Assembly: DWNet.Data.dll
Syntax
IDictionary<string, string> Templates { get; }
Return
System.Collections.Generic.IDictionary<string, string>
All of the templates in the model.
Examples
The following code example demonstrates how to use the Templates property.
using DWNet.Data;
using System;
using System.Collections.Generic;
namespace Appeon.ApiDoc.IExportXmlMetaExamples
{
public class TemplatesExample
{
private readonly SchoolContext _context;
public TemplatesExample(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 information of the XML export template in the DataStore model.
var windowMeta = datastore.DwMeta.DataWindow;
var exportMeta = windowMeta.Export;
var exportXmlMeta = exportMeta.Xml;
Console.WriteLine("Templates Count: {0}", exportXmlMeta.Templates.Count);
foreach (var item in exportXmlMeta.Templates)
{
Console.WriteLine("Name: {0}; Path: {1}", item.Key, item.Value);
}
/*This code produces the following output:
Templates Count: 1
Name: xml_defaultl; Path: Templates\xml_setparameter_default.xml
*/
}
}
}
Example Refer To
Model Class: D_Department
DataWindow File: d_department
Applies to
.NET Standard
2.x