Copied to clipboard

Flag this post as spam?

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


  • zell 37 posts 90 karma points
    Oct 26, 2016 @ 08:56
    zell
    0

    Accessing UserService in 7.3+

    Hi, i've just updated a project from 7.1.8 to 7.5.4 and i need to update all my usages of UserService. The function below is now obsolete:

        public static IContent ToIContent(this MyObject item)
        {
            ...
            var userService = new UserService(new RepositoryFactory());
            IUser author = userService.GetByEmail(item.AuthorEmail);
            ...
        }
    

    Is there another way to access user information? i'm trying to return a user based on their email address.

    i couldn't find any docos on the Services?

    thanks!

  • zell 37 posts 90 karma points
    Oct 26, 2016 @ 11:06
    zell
    0

    fixed. services can be accessed via:

    var userService = ApplicationContext.Current.Services.UserService;
    

    thanks! hope it helps someone else

Please Sign in or register to post replies

Write your reply to:

Draft