There is something that I unfortunately do not yet understand 100%. It's about the topic: "When do I call the base method of an overridden method?".
I basically understand what the base call of an overridden method does for the methods I have developed myself.
But now we come to ASP.NET Blazor and Synchronous or Asynchronous methods.
I have the OnParametersSet method and I have the OnParametersSetAsync method. I realize that one method is called synchronously and the processing of the 2nd method is asynchronous.
Example: I override the OnParametersSet method. Included is the call to the base method "base.OnParametersSet();".
Background is, I have relatively much nested single components. And in the topmost component, i.e. the main container, I load the data set to be processed (e.g. as interface IDto).
My question: do I now need to call base.OnParametersSet(); before or after my code. I think this has many consequences regarding the child components. But the exact consequences... Especially the availability of the dataset in the nested components is not clear to me.
I think it is good practise to call the base class first, and after that, do your own initialization.
The reason for that is that a base class does not know of it's descendants and therefore could overwrite changes you make to it frome descendant class.
If you call the base class first, you could apply modifications on default behavior of the base class, fully aware of that base class instance state.
This, by the way, is not a 'golden' rule.
When you are disposing an object, and overide the base class Dispose method, it is common practise to do your own cleaning up first, and after that, call the base class. The reason is that, when you have behaviour in your descending claas, that requires the baseclass not to be disposed, you may run into problems when disposing the base first.
So, as a rule of thumb, you could use the following:
(this, by the way, is also how inheritance works. The constructor of a base class is always executed before the constructor of the derived class. With the destructor, it is vice-versa.)
Good luck