Copied to clipboard

Flag this post as spam?

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


  • blackhawk 313 posts 1367 karma points
    Aug 23, 2017 @ 20:20
    blackhawk
    0

    How to find the name of the writer based on Entity WriterId

    I'm currently using ContentService Events to detect when a writer sends a content item for approval.

    I'm able to reference the writers id with the following code with the help of Entities.

     var mwriter = e.Entity.WriterId;
    

    But how do we also get the full name of the writer?

  • blackhawk 313 posts 1367 karma points
    Aug 23, 2017 @ 21:32
    blackhawk
    100

    Solved my issues by using Umbraco's ApplicationContext Class. The following helped:

    var mwriter = e.Entity.WriterId;
    var mwriterprofile = ApplicationContext.Current.Services.UserService.GetProfileById(mwriter).Name;
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies