SapphireDb
SapphireDb copied to clipboard
SapphireDbContext Constructor not working properly
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
Hi. Thank you for reporting this issue. I'll take a look into it.
Best regards Morris
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 ?
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.