Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to emulate missing property in object
Message
De
13/05/2007 09:24:37
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Titre:
How to emulate missing property in object
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01225060
Message ID:
01225060
Vues:
60
I'm implementing entity object which should populate its properties from
database when property is first referenced.

In RDL reports I use object properties like

MyObject.MyProperty

MyObject is instance of entity class. There is no MyProperty property in MyObject at design time.

I need to catch missing object reference and provide object value at run time. Something line

public class MyEntity {
override Exception Exception.MissingPropertyGetException {
return dbo.ExecuteScalar("SELECT "+Exception.UnreferencedPropertyName+
" FROM myEntity");
}
}
Andrus
Répondre
Fil
Voir

Click here to load this message in the networking platform