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

SapphireDbContext Constructor not working properly #18

Open
puschie286 opened this issue Sep 1, 2020 · 3 comments
Open

SapphireDbContext Constructor not working properly #18

puschie286 opened this issue Sep 1, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@puschie286
Copy link

Hi,
have problems getting the synchronization with Microsoft SQL server to work - beside synchronized between clients everything works fine ( tested add/remove/update ).

would be nice if you could have a look at it.

using sapphiredb 3.1.0 ( c# + js )
no errors in the log of server or client

note: when listen to changes() only the initial "QueryResponse" is received
and the collection subscription is called two times after "add" - first with the new entry and a second time without the new entry
guess that is related to that

@morrisjdev
Copy link
Collaborator

Hi.
Thank you for reporting this issue. I'll take a look into it.

Best regards
Morris

@morrisjdev morrisjdev self-assigned this Sep 2, 2020
@puschie286
Copy link
Author

found my mistake...
you have to define a DbContext constructor that takes the SapphireDatabaseNotifier as argument ( and pass it to base constructor )

to prevent things like that it would be good to make
"SapphireDbContext(DbContextOptions options)"
and
"SapphireDbContext()"
private so that you cant compile without an implemented constructor ( the ide will also generate the correct one )

what do you think ?

@morrisjdev
Copy link
Collaborator

Ok perfect.

Yes definitly an idea. A few releases before the parameterless constructor was not existent and you were forced to implement it. I added the parameterless constructor and added logic to get the SapphireDatabaseNotifier from DI automatically. Seems that this does not work in your case. I'll definitly investigate this behavior.

@morrisjdev morrisjdev changed the title SQL Server synchronization SapphireDbContext Constructor not working properly Sep 2, 2020
@morrisjdev morrisjdev added the bug Something isn't working label Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants