DataStore<TModel>.DataStore() Constructor
.NET Standard 2.x
Initializes a new instance of the DataStore class.
Namespace: DWNet.Data
Assembly: DWNet.Data.dll
Syntax
public DataStore();
Examples
The following code example uses a parameterless constructor to create a DataStore object.
using Appeon.ApiDoc.Models;
using DWNet.Data;
using System;
using System.Collections.Generic;
namespace Appeon.ApiDoc.DataStore_GenericExamples
{
public class DataStore_GenericExample
{
private readonly SchoolContext _context;
public DataStore_GenericExample(SchoolContext dataContext)
{
// Set Data Context
_context = dataContext;
}
public void Example1()
{
// Instantiates the datastore with d_department DataWindow.
var department = new DataStore<D_Department>();
department.DataContext = _context;
int row = department.Retrieve();
Console.WriteLine("Retrieve Count = {0}", row);
/*This code produces the following output:
Retrieve Count = 4
*/
}
}
}
Example Refer To
Model Class: D_Department
DataWindow File: d_department
Applies to
.NET Standard
2.x