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

Changing From MSSQL to PostreSQL Fails to Resolve Tenant #841

Open
japhethmutai opened this issue Jun 12, 2024 · 2 comments
Open

Changing From MSSQL to PostreSQL Fails to Resolve Tenant #841

japhethmutai opened this issue Jun 12, 2024 · 2 comments
Labels

Comments

@japhethmutai
Copy link

Hi @AndrewTriesToCode, I know this could be pretty simple setting on my end, but I have this rather weird behaviour. I developed a demo app with the package and initially used SQL for the database. Everything worked as expected, but when I tried to shift to NpSql, I experienced a behaviour that prevented me from using the app. I can generate migrations and apply them to the database successfully, including seeding the data to db. However, when I try to make a query from Swagger with the tenant Id added as query param, every time, it gives me the error of 'Object reference not set to an instance of an object.' because the tenant is null. I have tried finding out where the issue could be but I don't seem to resolve this problem. Here is the code for the project I am working with. Thank you in advance.

@RobinDavisNotts
Copy link

In AddInfrastructureServices you are calling AddMultitenancyServices before you call AddPersistenceService (which adds the IOptions for Database settings)

@japhethmutai
Copy link
Author

In AddInfrastructureServices you are calling AddMultitenancyServices before you call AddPersistenceService (which adds the IOptions for Database settings)

Hi @RobinDavisNotts, I tried rearranging these as suggested but still hitting the same error. Seems this didn't work or what do you suggest?

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

No branches or pull requests

3 participants