Archive for the ‘business entity’ tag
Generation of a Business Entity
Now it is time to generate some business entities from a model.
Suppose we have a simplified model with just one entity called Course. It has an unique identifier CourseID and a searchable and displayable attribute called CourseName.
To generate source code the model is injected into the following template.
The resulting generated code will look like this:
public class Course
{
public int m_CourseID;
public string m_CourseName;
public int CourseID
{
get
{
return m_CourseID;
}
set
{
if (value != m_CourseID)
{
m_CourseID = value;
}
}
}
public string CourseName
{
get
{
return m_CourseName;
}
set
{
if (value != m_CourseName)
{
m_CourseName = value;
}
}
}
}
That’s all.















