<placeholder> I fixed it!
Tl;dr: we used a CMS whose licensing cost alone is in the tens to hundreds of thousands of NOK yearly just to avoid (a lot of) issues we had with Entity Framework and the database.
The back-end of our system started out using a regular .NET Web Api solution. Quite simple, free, and easily workable. Or so we thought.
It started out with some regular database connection issues. Usually to be expected, and we quickly got them fixed with some excellent assistance from Amr on the FitTeam.
Then creating tables with proper keys became an issue, and we got that fixed in what we still think is the correct and intended way.
Then all hell broke loose.
Issues upon issues descended upon us, database deciding not to cooperate, our inexperience with Entity Framework became apparent, foreign keys not enjoying being foreign keys, and thus the path to hell was paved with good intentions and lots of swearing.
In hindsight, the back-end development should have been titled "Abandon hope all ye who enter here"
The last straw was when the database decided to refuse storing and updating objects.
Our fix? We recreated the Web Api using EPiServer, a total CMS/Commerce/Search/etc. solution, which costs in the tens to hundreds of thousands of norwegian kroners per year. This is what us two back-end guys usually work with. The most embarrassing thing is, it worked flawlessly. We had the full API up and running in about two hours, including some database deployment issues with the test server.
In other words, we used a dev version of the CMS, adding some major bloat to the solution and using the CMS pagetypes for models, just to completely avoid the CMS and things that makes EPiServer good. All this, just to avoid Entity Framework.
The best thing. It works flawlessly.