Create the class Employee.

NDO offers a simple way to create a new persistent class. In the NDO Toolbar just click at the Add Persistent Class button.

Add Persistent Class

In the following dialog enter Employee as class name. NDO generates a skeleton of the class which looks like this:

using System;
using System.Linq;
using System.Collections.Generic;
using NDO;
namespace BusinessClasses
{
    [NDOPersistent]
    public partial class Employee
    {
    }
}

Now add two private fields to the class:

string firstName;

string lastName;

Place the cursor on one of the fields and click on the Add Accessor button of the NDO toolbar:

Add Accessor

NDO automatically creates an accessor property for the field. An accessor property is a property with a getter and a setter, which is simply wrapped around a variable. After creating the accessor for both fields the code looks like this:

string firstName;

public string FirstName

{

    get { return firstName; }

    set { firstName = value; }

}

string lastName;

public string LastName

{

    get { return lastName; }

    set { lastName = value; }

}

Note, that you can use automatic properties instead:

string FirstName { get; set; }

string LastName { get; set; }

The separated fields and accessor properties give you more control while debugging.

Now the Employee class is ready. It is just an ordinary .NET class. The status of the employee objects is kept in private member variables which can be accessed with properties.

Note that NDO does not use the properties for persistence purposes. You can omit the properties, name it, or code it at will.

Note: NDO creates a partial class with an empty implementation of the IPersistentClass interface. This implementation is just for IntelliSense use. NDO is able to work without these interface implementations.