VS2012 / new Cloud project / MVC4 role / Membership issue

Answered VS2012 / new Cloud project / MVC4 role / Membership issue

  • 22. srpna 2012 6:40
     
     

    By default memberships work fine. I can register new user and link Google account.

    I would need Membership.FindUsersByName() method to be able to list members but that method returns "Specified method is not supported".

    I tried using SQLProvider also but then it is not possible to login anymore at all...

    Is there list which Membership functions work with that default membership provider?

    How can I specify password requirements etc which are usually specified in membership section of WebConfig?

Všechny reakce

  • 22. srpna 2012 8:55
     
     Odpovědět

    Problem solved. :)

    Looks like AccountModels.cs has UsersContext class. UserId can be searched from there quite easily.

    using (UsersContext db = new UsersContext())
        {
            UserProfile user = db.UserProfiles.FirstOrDefault(u => u.UserName.ToLower() == model.UserName.ToLower());

        }