IDataStore<TModel>.Reverse() Method
.NET Standard 2.x
Reverses the order of the elements.
Namespace: DWNet.Data
Assembly: DWNet.Data.dll
Syntax
void Reverse();
Examples
The following code example demonstrates how to reverse rows from the database for datastore.
using Appeon.ApiDoc.Models;
using DWNet.Data;
using System;
namespace Appeon.ApiDoc.IDataStore_GenericExamples
{
public class ReverseExample
{
private readonly SchoolContext _context;
public ReverseExample(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();
Console.WriteLine("Before Reverse, DepartmentID: ",
datastore.GetModel(0).Departmentid);
// Reverses the order of the rows.
datastore.Reverse();
Console.WriteLine("After Reverse, DepartmentID: ",
datastore.GetModel(0).Departmentid);
/*This code produces the following output:
Before Reverse, DepartmentID: 1
After Reverse, DepartmentID: 7
*/
}
}
}
Example Refer To
Model Class: D_Department
DataWindow File: d_department