blazor-state icon indicating copy to clipboard operation
blazor-state copied to clipboard

What is the reasoning behind the NonNestedClassException?

Open DerekChasse opened this issue 3 years ago • 1 comments

I'm wondering what the reasoning is behind this nested class convention?

I have a 'clean-architecture' setup in my application with a core project which defines Mediatr requests/notification/handlers etc... I have my own conventions applied. I'd love to use this project to also manage state across the different components/pages, but I'm butting heads with this convention. To make Blazor-State happy I need to wrap each Action and Handler with a unnecessary partial class definition and munge my namespaces to allow things to resolve.

https://github.com/TimeWarpEngineering/blazor-state/blob/70fea1e4bf3709a29492bad468e1d2f98bba80af/Source/BlazorState/Pipeline/RenderSubscriptions/RenderSubscriptionsPostProcessor.cs#L41

DerekChasse avatar Jun 28 '22 18:06 DerekChasse

Derek,

RenderSubscriptionsPostProcessor.cs This particular middleware is used to enforce the constraint.

And the DeclaringType is used by the CloneStateBehaviormiddleware to determine what State needs to be cloned.

I have a 'clean-architecture' setup in my application with a core project which defines Mediatr requests/notification/handlers etc...

Do you mean in your API code? I am not clear why this causes you an issue when managing the state used in the browser(client).
To give me a bit more context, are you doing Server Side Blazor or WASM? Are you using the "hosted" template/pattern?

If you have an example that you can share would also help.

Thanks

Feel free to reach out to me on discord. https://discord.gg/jY4TNPEuCX

StevenTCramer avatar Jun 29 '22 10:06 StevenTCramer