Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fluid ViewEngine in ASP.NET Core 6 SAAS Application does not reset ViewsLocationFormats for different Tenants #564

Open
kashifasif opened this issue Mar 18, 2023 · 0 comments

Comments

@kashifasif
Copy link

kashifasif commented Mar 18, 2023

Hi, I am using Fluid into ASP.NET Core 6 for an SAAS application and this application support that each tenant can upload or customize their own theme so this way each tenant has their own theme folder hierarchy like

  • Tenant 1 (tenant1.example.com): Themes -> Tenant1 -> Theme1 -> Pages -> Home.liquid
  • Tenant 2 (tenant2.example.com): Themes -> Tenant2 -> Theme2 -> Pages -> Home.liquid

And Some tenant can have themes from default themes which has different folder hierarchy like this

  • Tenant 3 (tenant3.example.com): Themes -> CommonThemes -> DefaultTheme -> Pages -> Home.liquid

So, i have configured the ViewsLocationFormats and ViewsFileProvider based on some condition so these are automatically configured and Format are generated.

Problem:
When i open Tenant 1 (tenant1.example.com) application, it succesfully loads the views and layout etc from own directory (Themes -> Tenant1 -> Theme1 -> Pages -> Home.liquid) but the problem thing is when other tenant try to open their application instance let say Tenan 3, Fluid automatically load Views from ViewsLocationFormats of Tenant 1 (tenant1.example.com) even ViewsLocationFormats should reset and should load views from their own directory. This is the case of all tenants and i have configured ConfigureOptions correctly.

After debuging the "FluidViewEngine" i have seen that inside "LocatePageFromViewLocations" method _options.ViewsLocationFormats never get reset. I expect that it should load new list from ConfigureOptions ni which i have confirure the ViewsLocationFormats and ViewsFileProvider and ConfigureOptions only invoked once at the start of application after publishing the application afterwards it never invoke again i think thats why it never get new View Formate List based.

So, can anyone please help me how i can achive it? Or i am doing something wrong in the code flow or this is default behavior of Fluid?

Note: for multitenancy i am using Finbuckle.

image

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant