Once a DataContext class has been defined, it must be associated with a DataContextDescriptor object. The subclasses of PeterBlum.DES.DataAnnotations.Descriptors.BaseDataContextDescriptor know how to parse the DataContext to extract details about it, the Entity classes it hosts, and the DataFields of those Entity classes. This information, called the Descriptors, forms the backbone of BLD’s operations. BLD cannot operate without them.
Here is a typical registration. Your code goes in the Global.asax file.
<%@ Application Language="C#" %>
<%@ Import Namespace="System.ComponentModel.DataAnnotations" %>
<%@ Import Namespace="PeterBlum.DES.BLD" %>
<%@ Import Namespace="PeterBlum.DES.DataAnnotations.Descriptors" %>
<script runat="server">
void Application_Start(object sender, EventArgs e)
{
BLD_Application_Start.RegisterDataContext(
typeof(PeterBlum.InitialEntities.NorthWindDataContext),
null,
PredefinedBLDRoute.IndividualActionFiles);
}
</script>
In the next topic, you will
use the BLD Database Explorer application to see our initial application.