1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Sitefinity 4.0 RC The method or operation is not implemented

Sitefinity 4.0 RC The method or operation is not implemented

8 posts, 0 answered
  1. Bobby
    Bobby avatar
    8 posts
    Registered:
    09 Nov 2010
    14 Dec 2010
    Link to this post
    Hi mates,

    I'm trying to implement a custom membership provider by inheriting MembershipDataProvider but always encountered this error: "The method or operation is not implemented." on 
    public override IQueryable<Telerik.Sitefinity.Security.Model.User> GetUsers().
    I even tried inheriting from OpenAccessMembershipProvider also without any luck.

    Any help will be highly appreciated.

    Thanks,
    Bobby
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    14 Dec 2010
    Link to this post
    Hi Bobby,

    Please take a look at this post. Currently, you cannot use the membership, role and profile wrappers.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Bobby
    Bobby avatar
    8 posts
    Registered:
    09 Nov 2010
    15 Dec 2010
    Link to this post
    Hi Ivan,

    I've already read the post/thread. Please correct me if I'm wrong, but are you saying that Custom Membership/Role/Profile is not possible to implement at this current version of Sitefinity that is 4.0 RC?

    Thanks,
    Bobby
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    15 Dec 2010
    Link to this post
    Hi Bobby,

    You cannot use the wrappers like MembershipProviderWrapper. You have to inherit from OpenAccessMembershipProvider or MembershipDataProvider

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Bobby
    Bobby avatar
    8 posts
    Registered:
    09 Nov 2010
    15 Dec 2010
    Link to this post
    Hi Ivan,

    Yes I did inherit from  MembershipDataProvider and OpenAccessMembershipProvider. And I got this error:

    "The method or operation is not implemented." on 
    public override IQueryable<Telerik.Sitefinity.Security.Model.User> GetUsers().

    Please see attached code for reference.


    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    using Telerik.Sitefinity.Security.Data;

    using Telerik.Sitefinity.Security;

    namespace SmartAccount2
    {
        public class CustomMembership : MembershipDataProvider
        {

            public override Telerik.Sitefinity.Security.Model.User CreateUser(Guid id, string userName)
            {
                //var userManager = UserManager.GetManager("Default");
                throw new NotImplementedException();
            
            }

            public override Telerik.Sitefinity.Security.Model.User CreateUser(string userName)
            {
                //var userManager = UserManager.GetManager("Default");
                throw new NotImplementedException();
               
            }

            public override void Delete(Telerik.Sitefinity.Security.Model.User item)
            {
                //var userManager = UserManager.GetManager("Default");
                throw new NotImplementedException();
              
            }

            public override Telerik.Sitefinity.Security.Model.User GetUser(Guid id)
            {

                //throw new NotImplementedException();

                //var userManager = UserManager.GetManager("Default");
                //Telerik.Sitefinity.Security.Model.User user = userManager.GetUsers().Where(u => u.Id == id).Single();
                //return user;
                return null;

            }

            public override IQueryable<Telerik.Sitefinity.Security.Model.User> GetUsers()
            {
                //throw new NotImplementedException();
                using (SmartAccountEntities Entity = new SmartAccountEntities())
                {
                    var list = (from u in Entity.Users
                                select u).AsQueryable();

                    return (IQueryable<Telerik.Sitefinity.Security.Model.User>)list;
                }
              
            }

        }

    }


    Thanks,
    Bobby
     
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    15 Dec 2010
    Link to this post
    Hi Bobby,

    Your screenshot shows that you use MembershipProviderWrapper and GetUsers() is not implemented there.
    Can you share the code you use? Do you have implementation for GetUsers() , because MembershipDataProvider is abstract class.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Bobby
    Bobby avatar
    8 posts
    Registered:
    09 Nov 2010
    15 Dec 2010
    Link to this post
    Hi Ivan,

    Please see updated post. By the way, I'm getting user records from our separate account database. And how can I cast to Telerik.Sitefinity.Security.Model.User type.

    Thanks,
    Bobby
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    16 Dec 2010
    Link to this post
    Hi Bobby,

    I cannot replicate any issue with a custom provider that inherits from MembershipDataProvider. I attached short video and you can find my code pasted below.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Telerik.Sitefinity.Security.Data;
    using Telerik.Sitefinity.Security.Model;
    using Telerik.Sitefinity.Security;
     
    namespace Telerik.Sitefinity.Samples
    {
       public class MembershipDataProviderCustom : MembershipDataProvider
        {
            public override Security.Model.User CreateUser(string userName)
            {
               //
                return null;
            }
     
            public override Security.Model.User CreateUser(Guid id, string userName)
            {
                //
                return null;
            }
     
            public override Security.Model.User GetUser(Guid id)
            {
               //
                return null;
            }
     
            public override IQueryable<Security.Model.User> GetUsers()
            {
              //
                List<User> list = new List<User>(1) ;
                var manager = UserManager.GetManager();
                var q = manager.GetUsers().Where(us => us.UserName == "test1").SingleOrDefault();
                if (q == null)
                {
                    var u = manager.CreateUser("test1");
                    manager.SaveChanges();
                    list.Add(u);
                    return list.AsQueryable<User>();
                }
               list.Add(q);
               return list.AsQueryable<User>();
            }
     
            public override void Delete(Security.Model.User item)
            {
               //
            }
        }
    }


    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
8 posts, 0 answered