Upgrade 8 to 10. How do we access services now? (M...
# help-with-umbraco
b
We are doing an upgrade on one of our sites from V8 to V10. We need to access Services (which used to be accessible via the UmbracoViewPage class) so we can then get access to the MemberService. How do we access services now?
m
You can now use @inject within views so you can do @inject IMemeberSerivce
s
Dependency injection - something like this: https://docs.umbraco.com/umbraco-cms/reference/using-ioc#umbracohelper But instead of requesting a
IUmbracoHelperAccessor
you ask for a
IMemberService
. Ah yes as Matt says, you can also use
@inject
in your views.
b
Amazing thank you very much for the info guys. I will give that a blast 😄 none of us have worked with upgrading Umbaco before so it's very much appreciated
p
@User May I suggest “Umbracians” instead of "guys"? We use gender inclusive language in this Discord. 😀
m
If you don't like @inject in views, take a look at ViewComponents