DataLayer

Because the goal is to poke around APS.NET, the data model is short and simple. Two tables will be constructed—Department and Employee. The table layouts appear in Figure 4.2.1.

Figure 4.2.1. The Stingray database tables.

Custom attributes were briefly discussed earlier, but now is a good time to make full use of them. The data layer will define two attributes, a DBTableAttribute and a DBFieldAttribute. These attributes will contain the necessary information to invoke stored procedures in a fairly generic manner. The Reflection API can be used to locate attributes and properties of an object. Thus, our custom attributes can be located ...

Get C# and the .NET Framework: The C++ Perspective now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.