CoreWiki icon indicating copy to clipboard operation
CoreWiki copied to clipboard

Adding a NoSQL data provider (Couchbase)

Open mgroves opened this issue 7 years ago • 3 comments
trafficstars

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?

mgroves avatar Sep 10 '18 14:09 mgroves

EF tight-coupling has been dropped... and you should be able to implement IRepository objects appropriately

csharpfritz avatar Sep 20 '18 15:09 csharpfritz

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?

mgroves avatar Sep 22 '18 16:09 mgroves

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.

csharpfritz avatar Sep 29 '18 15:09 csharpfritz