Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you specfiy Business Entity to use within the BO?
Message
De
07/04/2008 11:03:16
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
07/04/2008 00:14:07
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01308629
Message ID:
01308717
Vues:
14
Matt,

Override the factory CreateEntityObject()and put a decision in there. You could set a property to drive the decision as one method.

Tim

>I read in the Dev Guide about "Working with Different Shaped Entities", and I think I need to do this in a few cases, so... How do you tell the Business Object *WHICH* Entity to use when it is instantiated? I see how to create additional Entity "shapes" using the Business Layer Generator, but how do I create an instance of a my Customer BO on one form that is based on the default Entitiy, but also have a Customer BO on another form that is based off a different Entity definition?
>
>In looking at my Customer.cs code file for the Customer BO, it seems to pretty much be hard-coded to use the default CustomerEntity entity class.
>
>Also, can you switch between Entities within one instance of a BO object?
>
>Code below is from Customer.cs:
>
>
> public partial class Customer : ABusinessObject
> {
>
> #region Association Properties
>
> ///
> /// Business Entity object
> ///

> public override CustomerEntity Entity
> {
> get
> {
> if (this._entity == null)
> {
> this._entity = this.CreateEntityObject();
> }
> this._entity.SetDataRow(this.DataRow);
> return this._entity;
> }
> set
> {
> this._entity = value;
> if (this._entity != null)
> this.DataRow = this._entity.GetDataRow();
> else
> this.DataRow = null;
> }
> }
> private CustomerEntity _entity;
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform