Comments (3)
My preference is to NOT use BusinessRules to load complex objects (as in Lazy Load Properties).
A business rule must be considered a singelton and shared instance for ALL instances of this type. So the only way to send parameters is to pass them as properties in the BO.
You must also remember that rules may be run often - and not just when a property is changed.
There is some possibilities to limit when a rule is called, look at PropertyRule base class and the properties:
- CanRunAsAffectedProperty
- CanRunInCheckRules
- CanRunOnServer
And see my blog post https://jonnybekkum.wordpress.com/2011/08/29/csla-4-2-rules-update/
You must also be aware that the PropertyChanged event is also used to notify the UI of "possible" changes in a property in order to update the displayed value.
You could also implement this in the ViewModel - that already has the CustomerID and DoorID by subscribing to the PropertyChanged on the DoorDetail object.
from cslaforum.
You could store values into LocalContext dictionary and have the rule read values from the context - but I would not recommend that approach.
from cslaforum.
The business object should contain all the information necessary for it to do its work. If it needs those values, then those values should be properties (probably read-only) in the object.
I wouldn't think they'd be passed in by the viewmodel - they'd be provided as part of the criteria used to create/fetch the object.
If those values are changing during the lifetime of the object, then perhaps your object model needs to be rethought a little to recognize that there are other objects at play.
from cslaforum.
Related Issues (20)
- Quick questions about Csla 5.xx HOT 2
- Rocky Lhotka and CSLA .NET AMA survey
- 2 Blazor Questions HOT 7
- HttpProxy Authentication Problem HOT 8
- Including DataPortalController in Blazor.Server HOT 4
- Add virtual to Parent HOT 1
- Blazor ViewModel additional functionality (3 questions) HOT 25
- CSLA version 5.2.0 prerelease 20042401
- Blazor ViewModel GraphMerger error on loading managed property HOT 7
- Live interactive discussion about CSLA .NET May 14, 2020 HOT 6
- ASP.NET Core - iOS Specific - Unable to read beyond the end of the stream HOT 7
- CSLA version 5.2.0 prerelease 20042901
- how to convert Csla.ApplicationContext.User to SLMPrincipal class ? HOT 2
- "Data binding" for rules HOT 3
- Dapper and Csla Helper Classes HOT 3
- CSLA 5.2.0-20050802 prerelease
- Require Dependency Injection HOT 7
- Blazor Server Side. Authorization not work when deploy on Azure WebSite with SignalR HOT 2
- Async call for CSLA 5.2.0-R20050802 HOT 2
- NEW FORUM LOCATION HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cslaforum.