BO default properties


Author
Message
Peter Jones
Peter Jones
Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi,

Is there any way of changing the 'default property values' when a new BO is created? For example the default AllowNullValuesOnNewRows is False and it may be that, in most cases, we would like that value to be True in which case it would be useful if we could have all new BO's start with a AllowNullValuesOnNewRows of True.

Cheers, Peter 

Reply
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Ah, I see, the problem is stemming from the way that .NET handles constructors.... if you don't define a constructor in a class, .NET defines a default constructor with no parameters for it.  So, when you call MyBase.New(info, context), your inherited class cannot see through your BO base class to the constructors within BusinessLayer because a new constructor has been defined. 

So, do this... go ahead and create the constructors in your base class, but take out all of the code except the MyBase.New(...) call and the call to InitializeComponent().  Mainly just remove your call to AddHandlers() or else the business rules and default values events will be handled twice per class (that is of course if you don't want to put any default or rules checking code in the base class... if you do, then you'll want to leave the calls to AddHandlers() so that you can check them in both places.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Peter Jones - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Peter Jones - 18 Years Ago
StrataFrame Team - 18 Years Ago
StrataFrame Team - 18 Years Ago
Peter Jones - 18 Years Ago
Peter Jones - 18 Years Ago
             Glad to hear it :)
StrataFrame Team - 18 Years Ago
Peter Jones - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Peter Jones - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Peter Jones - 18 Years Ago
Peter Jones - 18 Years Ago
Peter Jones - 18 Years Ago
StrataFrame Team - 18 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search