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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.