CoreWiki
CoreWiki copied to clipboard
Adding a NoSQL data provider (Couchbase)
It was suggested on Twitter that I could try creating a data provider using a NoSQL database (like Couchbase). I took a look at the code and there appears to be a Data.Abstractions project that I could use pretty easily. However, I'm not quite sure how to proceed with a couple of other pieces, and it looks like the architecture might be tightly coupled with EF.
- AddRepositores in StartupExtensions.cs - it looks like I could add another case statement here, but what about the AddDbContextPool that follows. Is that something that's EF specific?
- ConfigureDb in IdentityHostingStartup.cs - this looks like it also contains some EF specific code?
Am I wrong about the tight coupling with EF? How should I proceed?
EF tight-coupling has been dropped... and you should be able to implement IRepository objects appropriately
I'm still having trouble trying to figure out where to start. In Startup.cs, there's a call to services.ConfigureDatabase, which in turn calls services.AddRepositories. AddRepositories seems very much coupled to EF. I can think of a few ways to refactor this, but I'm guessing your intent is that I shouldn't have to make changes to Startup.cs. Could you perhaps point me in the right direction? Or if you already covered this in a stream, could you point me toward the correct recording?
You're right.... we will need to put a provider lookup into the ConfigureDatabase methods.
We'll take care of that on stream very soon.