Copied to clipboard

Flag this post as spam?

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


  • Leandro Alves 1 post 71 karma points notactivated
    Dec 26, 2023 @ 16:18
    Leandro Alves
    0

    IUserService is inacessibel due to it ptotection level

    Hi there. I'm trying to access to IUserService on a controller without sucess. I try to replicate the tutorial on a controller that inherits from UmbracoApiController.

    First off all in tutorial point to namespaces:

    using Umbraco.Core; 
    using Umbraco.Core.Models; 
    using Umbraco.Core.Services; 
    

    But I can only get access using Cms, like this:

    using Umbraco.Cms.Core; 
    using Umbraco.Cms.Core.Models; 
    using Umbraco.Cms.Core.Services; 
    

    After that, when I try to get access to UserService, I get an error, UserService is inacessibel due to it ptotection level. enter image description here

    Any ideas what I've been doing wrong? Regards, L.A.

  • Yakov Lebski 591 posts 2347 karma points
    Dec 31, 2023 @ 23:14
    Yakov Lebski
    0

    just inject IUserService to constractor

Please Sign in or register to post replies

Write your reply to:

Draft