Replies: 2 comments
-
If I understand your question correctly, I think you are mixing up the definition of the contract that the data portal implementations must fulfil with what the data access methods in your business objects must be like. The method signature you have shown appears to be to be what a data portal implementation must fulfil, which for most people is an internal implementation detail you do not need to worry about. This only matters if you build your own data portal. If you are creating a data access method in a CSLA business object, then it should be void-returning and have one of the [Fetch], [Insert], [Update], [Delete] or [DeleteSelf] attributes applied. That's more or less the only absolute requirement from a technical perspective; you will want to pass parameters to provide context (such as an integer or Guid identify for a fetch operation) but what parameters you pass is entirely up to you. Take a look at the BlazorExample project in the Samples folder for an example of how to build CSLA objects, for example https://github.com/MarimerLLC/csla/blob/main/Samples/BlazorExample/BlazorExample/Shared/PersonEdit.cs |
Beta Was this translation helpful? Give feedback.
-
From the perspective of a business developer, @TheCakeMonster covers the primary change: the server-side data portal operation methods are now identified by operation attributes such as [Fetch]
private void Fetch(int id)
{
} The client-side code should no longer use any @inject IDataPortal<PersonEdit> portal
@code
{
private async Task ButtonClick()
{
var person = await portal.FetchAsync(123);
]
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am at a complete loss as to how to implement DataPortal methods under CSLA 7.
Here's the Fetch method signature from CSLA 7:
What is the required parameter:
DataPortalContext context
From where do I get it and how do I provide it?
Thanks in advance for helping me out on this - trying to upgrade to the latest and greatest!!
Beta Was this translation helpful? Give feedback.
All reactions