Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Constructor Hooks
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01222803
Message ID:
01223426
Vues:
15
Hi!

That will work!

Thanks!

Sarosh

>Sarosh,
>
>>Just wondering what the correct approach would be in creating a Pre/Post Constructor Hook for BO's?
>
>You can add a hook method in ABusinessObject. For example:
>
>
public ABusinessObject()
>{
>	this.DatabaseKey = "PostgresTest";
>	this.HookInit();
>}
>
>public virtual void HookInit()
>{
>}
>
>I'm not sure that a "dual" hook is necessary here (pre/post) due to the specialness of constructor methods...they are automatically called from the top down (from System.Object down to your application-level class) and they are not inherited. At any rate, this provides a hook into which you can place constructor code that can be added to a partial class that is not overwritten.
>
>FYI, although we already generate all our business object classes as partial classes, we are adding the option to the BLG so it will generate these for you.
>
>Best Regards,
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform