I tried "to suggest something" in github, but N. Taylor Mullen does not seem capable to give any answer…
So I try here.
Context
I have built a plugin system, based on Application Parts, for my Asp.Net Core MVC apps.
Each plugin have its own MVC components (With Get and Post… so View Components are useless here).
The plugins, which are almost all embedded in pages, are of two kinds:
"Local plugin" | "Api Provider based plugins" |
Signalr based messenger | Microsoft Api |
Webmail | Google Api |
Statistics | etc |
Api Provider based plugins
I use Ajax call to load the content of "Api Provider based plugins", like Google, Ms, etc… in div tags.
As these plugins are potentially "deadlocks" for my app (depending on the Api request, and failures, It can take at least 3 seconds to load the page, or unlimited time…), it's fine.
"Local plugins"
Here is the problem.
My Signalr based, Statistics and all other "local plugins",
need their own model.
But, RenderPartialAsync feeds the called controller with its own model or viewData, leading to a mismatch between what the plugin controllers need, and what the caller of RenderPartialAsync give. For now I use for any plugin Ajax Call, but it will be "better"/simpler/natural to use pure ASP.NET Core solution for these "local plugins".
But on the other hand, there is nothing in ASP.NET Core MVC which facilitates the work.And I must admit that I find this situation very strange, in web modular era… Clearly, something is missing…
Anyway, if I build a "pure" ASP.NET Core solution, the result will be complex, and worst than that, it is likely to be broken soon or later…
So my questions are:
- What to do? Keep this Ajax architecture for all my plugins?
- How do you deal with similar situations?
- Am I missing something?
Thanks