Skip to content

Make inheritance of data portal operation attributes optional #4616

@rockfordlhotka

Description

@rockfordlhotka

Make the change in #4090 be optional so people can get the old behavior.


Discussed in #4595

Originally posted by hoangcuongvn March 14, 2025
I upgrading my project that used Csla 8 to the new Csla 9. In Csla 8, all legacy DataPortal_XYZ and Child_XYZ methods are ignored. So in my project, many classes are declared like below and they worked fine as expected. But Csla 9 suddenly supports back those legacy methods and all my classes now crash. E.g if I call _portal.Execute()

  • In Csla 8, the method XCommandBase.execute() is invoked as expected
  • But in Csla 9, the method DataPortal_Execute() is invoked => this causes the app works incorrectly.

Is it possible (e.g through configuration) to make Csla 9 not use those legacy methods?

public abstract XCommandBase<T>: CommandBase<T>
{
    [Execute]
    private Task execute()
    {
      return DataPortal_ExecuteAsync();
    }

    protected virtual void DataPortal_Execute()
    {
      throw new NotImplementedException(nameof(DataPortal_Execute));
    }

    protected virtual Task DataPortal_ExecuteAsync()
    {
      DataPortal_Execute();
      return Task.CompletedTask;
    }
}
```</div>

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions