Creating the Address Class
Add a new class with the name Address to the travel expense accounting project. Insert the following code:
using System;
using NDO;
namespace BusinessClasses
{
[NDOPersistent]
public class Address
{
private string countryCode;
private string zip;
private string street;
private string city;
public Address()
{
}
public string CountryCode
{
get { return countryCode; }
set { countryCode = value; }
}
public string Zip
{
get { return zip; }
set { zip = value; }
}
public string Street
{
get { return street; }
set { street = value; }
}
public string City
{
get { return city; }
set { city = value; }
}
}
}
As you can see, this class is built the same way as the class Employee. It has four private fields. Objects of this class are saved in their own database table.