UmbracoDocs icon indicating copy to clipboard operation
UmbracoDocs copied to clipboard

add info on context registration

Open jemayn opened this issue 1 year ago • 9 comments

Description

Added documentation on registering the dbcontext in EF Core and Umbraco for different usecases. Fixes #5595

Type of suggestion

  • [ ] Typo/grammar fix
  • [ ] Updated outdated content
  • [X] New content
  • [ ] Updates related to a new version
  • [ ] Other

Product & version (if relevant)

Umbraco 12

I've moved the existing database.md article in the root of the Extending section into a new database folder and renamed it database-with-npoco.md while also adding the new info in that same folder as database-with-efcore.md to keep them seperated.

Let me know if anything needs changed, been a while since I kept up with the structure and conventions of the Umbraco Docs 🙂

jemayn avatar Nov 08 '23 09:11 jemayn

@jemayn Thanks for the PR 😄

Before we review it, could you please make sure the new articles are added in the SUMMARY.md file? That way it will be shown in the navigation 😄

Then we will make sure to review it ASAP 😄

jonat123 avatar Nov 10 '23 10:11 jonat123

Hey @jonat123

I will get them added, I've also been made aware that this has all changed drastically from v12.3 due to https://github.com/umbraco/Umbraco-CMS/pull/14937 so will do some testing and update.

Marked it as draft for now pending changes.

jemayn avatar Nov 10 '23 10:11 jemayn

@jemayn What is the status of this PR? Are you still planning on testing and updating the PR?

jonat123 avatar Feb 12 '24 09:02 jonat123

@jonat123 it is in a strange state 😅

The PR to obsolete the old way of doing this was merged, but the new way is a lot worse IMO - so we atleast still use the obsolete method. There is a PR under review to improve the new way to be better which hopefully makes it in before the old way is entirely removed..

So awaiting https://github.com/umbraco/Umbraco-CMS/pull/15186 atm

jemayn avatar Feb 12 '24 09:02 jemayn

Thanks for letting us know 👍

jonat123 avatar Feb 12 '24 09:02 jonat123

Think we are good to merge this in when https://github.com/umbraco/Umbraco-CMS/pull/15186 gets merged 😁

Zeegaan avatar Mar 01 '24 10:03 Zeegaan

@Zeegaan This draft PR does not show how to use the non obsolete way to register the context.

@jemayn can you update the PR to show how to register the context in a non obsolete way?

Thanks!

AaronSadlerUK avatar Mar 01 '24 18:03 AaronSadlerUK

@AaronSadlerUK we still use the obsolete method.

Nikolaj has described the way to get the same result currently in this comment: https://github.com/umbraco/Umbraco-CMS/pull/14937#issuecomment-1805669857

However, that is not a good solution - and what prompted https://github.com/umbraco/Umbraco-CMS/pull/15186. So until that has been merged in we are sticking with the obsolete method which still works just fine.

jemayn avatar Mar 04 '24 08:03 jemayn

Ah gotcha that makes sense...

Although it's rather annoying to do a piece of work knowing I'll have to redo it again soon 😔

AaronSadlerUK avatar Mar 04 '24 09:03 AaronSadlerUK