After loading your BusinessEntity you can add custom columns, this is typically done to create a calculated column, however, it can be used to add a column just to hold state, it will not be saved to the database of course.
The newly created DataColumn
VB.NET
Dim emps As New Employees
If emps.LoadAll() Then
Dim col As DataColumn = emps.AddColumn("FullName", Type.GetType("System.String"))
col.Expression = Employees.ColumnNames.LastName + "+ ', ' + " + Employees.ColumnNames.FirstName
Dim fullName As String
Do
fullName = CType(emps.GetColumn("FullName"), String)
Loop Until Not emps.MoveNext
End If
C# Employees emps = new Employees();
if(emps.LoadAll())
{
DataColumn col = emps.AddColumn("FullName", Type.GetType("System.String"));
col.Expression = Employees.ColumnNames.LastName + "+ ', ' + " + Employees.ColumnNames.FirstName;
string fullName;
do
fullName = emps.GetColumn("FullName") as string;
while(emps.MoveNext());
}
EasyObject Class | NCI.EasyObjects Namespace