Load referenced DataPortal object in blazor #2299
-
I have a DataPortal object called AgencyList I'm loading AgencyList as below Any help is appreciated, Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The idea behind CSLA is that you design your object model to meet the needs of each user scenario. This is often driven by the requirements of the UI. My recommendation is that if you have a read-only list you are displaying to the user, that you update the list to contain the fields (properties) required by the scenario and UI. However, if you are retrieving a single object to display a lot of properties to the user, and also you have a page that edits those very same properties, then I'd personally re-use the same read-write business type (in your case AgencyEdit) for both pages. I would not create a read-only list based on AgencyEdit objects though, because that'll often cause major performance issues over time. You'd be misusing AgencyEdit (giving it multiple responsibilities, and so violating the single responsibility pattern). That might get your app working today, but you'll curse yourself (or someone will curse you) in the future. |
Beta Was this translation helpful? Give feedback.
The idea behind CSLA is that you design your object model to meet the needs of each user scenario. This is often driven by the requirements of the UI.
My recommendation is that if you have a read-only list you are displaying to the user, that you update the list to contain the fields (properties) required by the scenario and UI.
However, if you are retrieving a single object to display a lot of properties to the user, and also you have a page that edits those very same properties, then I'd personally re-use the same read-write business type (in your case AgencyEdit) for both pages.
I would not create a read-only list based on AgencyEdit objects though, because that'll often cause major pe…