Now that we have our simple OrderHeader
class, we need to create some properties to actually hold our data. Let's get started.
Remember the OrderHeader table we created in Chapter 2, shown in the following screenshot? Let's add the Id and Number fields as properties in our class.
Open the
OrderHeader
class that we created earlier in this chapter. There are numerous ways to create a property, but we'll start by just creating them manually. Under the default constructor we created earlier, let's create a private variable to hold the Id field. We will create these as private variables to hide the functionality from the end user, as we want them to use our properties.In C#, we declare the variable as an
int
, which is a shortcut forInt32
.private int _id;
In VB.NET, we will declare the...