IDataStore.GetValidate(short column) Method
.NET Standard 2.x
Gets the validation rule for a column (specified by the column index) in the DataStore. This validation rule will be checked when calling the Update
or Validate
method.
Namespace: DWNet.Data
Assembly: DWNet.Data.dll
Syntax
public string GetValidate(short column);
Parameters
column
System.Int16
The zero-based column number to get data.
Returns
System.String
Returns the validation rule for the specified column.
Examples
The following code example demonstrates how to get the validation rule for the departmentid column.
using DWNet.Data;
using System;
namespace Appeon.ApiDoc.IDataStoreExamples
{
public class GetValidateExample
{
private readonly SchoolContext _context;
public GetValidateExample(SchoolContext dataContext)
{
// Sets the data context
_context = dataContext;
}
public void Example1()
{
// Instantiates a DataStore object with datawindow: d_department.
var datastore = new DataStore("d_department", _context);
datastore.Retrieve();
// Sets the validation rule for the departmentid column:
// value must be larger than 0.
datastore.SetValidate(0, "departmentid > 0");
// The lower bound of column is 0.
// Gets the validation rules for the departmentid column.
string validation_rule = datastore.GetValidate(0);
Console.WriteLine("Validation Rule: {0}", validation_rule);
/*This code produces the following output:
Validation Rule: departmentid > 0:
*/
}
}
}
Example Refer To
Model Class: D_Department
DataWindow File: d_department