Copied to clipboard

Flag this post as spam?

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


  • Josh G 12 posts 53 karma points
    Feb 15, 2018 @ 16:32
    Josh G
    0

    MemberService.GetByUsername does not appear in IMemberService

    When I try and use the following:

    ApplicationContext.Current.Services.MemberService.GetByUsername("username").

    I'm receiving the following error?

    Umbraco.Core.Services.IMemberService' does not contain a definition for 'GetByUsername'

    Does anyone have any ideas what could be causing this.

    Thanks J

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Feb 15, 2018 @ 19:15
    Alex Skrypnyk
    0

    Hi Josh

    What version of Umbraco are you using?

    Just tested in 7.7.7 and 7.8.1 - it works for me

    /Alex

  • Josh G 12 posts 53 karma points
    Feb 15, 2018 @ 21:15
    Josh G
    0

    7.7.something..

    I know it worked for me in the same controller elsewhere so I’m a bit stumped as to what could possibly be different....

    I’ve got a registration function that this works perfectly, then in the function it just falls over!

    I’m at a bit of a lose really, so was wondering if any one could figure out where I’m being stupid..

    Another thought; should I be using the membership helper for this? I’m want to check if a member already exists before I create a new member.

    https://our.umbraco.org/apidocs/csharp/api/Umbraco.Web.Security.MembershipHelper.html#methods

  • Josh G 12 posts 53 karma points
    Feb 23, 2018 @ 00:15
    Josh G
    101

    Solved using the membership helper.

  • 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