| 
0
 | 
     1 <p class="j">
 | 
| 
 | 
     2 The following example shows how to create objects of different types coming from the same data source.
 | 
| 
 | 
     3 </p>
 | 
| 
 | 
     4 <p class="j">
 | 
| 
 | 
     5 Typically, to create an object, BLToolkit calls the <i>TypeAccessor.CreateInstanceEx</i> method.
 | 
| 
 | 
     6 First of all, this method verifies if there is an object factory (<i>ObjectFactory</i> property)
 | 
| 
 | 
     7 associated with the creating objects type.
 | 
| 
 | 
     8 If the property value is not null, it is used to create an object.
 | 
| 
 | 
     9 </p>
 | 
| 
 | 
    10 <p class="j">
 | 
| 
 | 
    11 The <i>ObjectFactory</i> property can be assigned explicitly at any time or 
 | 
| 
 | 
    12 by decorating the target class with the <i>ObjectFactory</i> attribute.
 | 
| 
 | 
    13 </p>
 | 
| 
 | 
    14 
 | 
| 
 | 
    15 ObjectFactory.cs
 | 
| 
 | 
    16 <% ..\..\..\HowTo\Reflection\ObjectFactory.cs %>
 | 
| 
 | 
    17 App.config
 | 
| 
 | 
    18 <% Doc\Data\App.config %>
 | 
| 
 | 
    19 <a href="..\Data\CreateSql.htm">Create.sql script</a>
 |