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 11 posts 52 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 6132 posts 23951 karma points MVP 7x 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 11 posts 52 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 11 posts 52 karma points
    Feb 23, 2018 @ 00:15
    Josh G
    101

    Solved using the membership helper.

Please Sign in or register to post replies

Write your reply to:

Draft