18 Feb 2004
Link to this post
02 Oct 2013
in reply to
Yeah, this is an issue with the current implementation of this provider (MembershipDataProvider).
Let me explain:
If you look at the code, the GetUsers method is by default returning an empty IQueryable, which is normal and could be implemented.
The issue arises with a large number of users. Since this IQueryable returns ALL users and then querying them with LINQ (in memory) there will be a performance hit.
So, if you view the users grid in the backend, and have like 1 million users from your custom provider, all 1 million users will be returned. This will happen on every page.
Inside the default Sitefinity provider this does not happen, since they are using their own Queryable LINQ implementation with OpenAccess, which returns the user records already filtered.
Other options would be to use OpenAccess and Sitefinity's way of implementing these features, or even maybe a custom implementation of the query.
So, regarding your case: if you only need this Membership Provider to authenticate and authorize users, you maybe should not implement these methods that come with the MembershipDataProvider, since it causes these issues.
If you do need to list and edit users from your custom database, you should create this custom implementation for your Queries.
If you have any questions, let me know.