Let's go back to our Data Access Objects we created earlier and give them a little more substance.
We will start by opening up the
ContactDataControl.cs
orContactDataControl.vb
as appropriate, and adding a FieldNames structure. At the top of the file, under the class declaration, add the following code:#region FieldNames public struct FieldNames { public const string Id = "Id"; public const string LastName = "LastName"; public const string FirstName = "FirstName"; public const string Email = "Email"; public const string Addresses = "Addresses"; public const string Phones = "Phones"; public const string BillToOrderHeaders = "BillToOrderHeaders"; public const string ShipToOrderHeaders = "ShipToOrderHeaders"; } #endregion
The VB.NET structure will look as follows (don't forget the private variable):
#Region "FieldNames" Public Structure FieldNames Public Const Id As String = "Id" Public Const LastName...