Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Jannik Anker 48 posts 258 karma points c-trib
    Jul 15, 2021 @ 12:31
    Jannik Anker

    Custom database CRUD (or, where is my IScopeProvider?)

    Ahoy-hoy people!

    I'm working with v9 RC1, trying to create repositories/services for my custom tables (created via migrations), and I thought it would be pretty much same procedure as last version, but... the docs say there should be an IScopeProvider but it's nowhere to be found? I've even checked the Umbraco source and it's not there.

    If the scope provider is gone for good, I'm not sure how I would get to work with the database :-(

    Got any pointers?

  • Jannik Anker 48 posts 258 karma points c-trib
    Jul 15, 2021 @ 12:49
    Jannik Anker

    Well, color me surprised :-D

    My repositories were placed in a separate project which only had the Umbraco.Cms.Core package installed. No IScopeProvider there, in spite of it belonging to the Umbraco.Cms.Core namespace.

    However, I tried to find it in my website project, and there it is! Turns out I need the Umbraco.Cms.Infrastructure package on top of Umbraco.Cms.Core in my separate project.

    Kinda sucks that the namespaces seem to be all over the place now :-(

  • Harry Spyrou 212 posts 604 karma points
    Jul 15, 2021 @ 13:37
    Harry Spyrou

    Someone else more experienced can correct me if I'm wrong, but it seems in line with how .NET Core is built. Less things are in .Core packages now and if you need more, you can add a package and use it in your code.

    I think Microsoft does the same thing with .NET 5.

    E.g. you have a Microsoft.Azure.Storage package and then if you need to use something that's not part of the Core, you install Microsoft.Azure.Storage.Extensions or something of the sort.

  • Jannik Anker 48 posts 258 karma points c-trib
    Jul 15, 2021 @ 15:20
    Jannik Anker

    Yeah, you're right, and I'm not really opposing that way of doing things. What bothers me is that the Umbraco.Cms.Core namespace is being used all over the place, meaning that I have to install Umbraco.Cms.Infrastructure to get access to functionality within the Umbraco.Cms.Core namespace. That (to me) makes it very difficult to know what is where, and why. Might just be me.

Please Sign in or register to post replies

Write your reply to: