If you script out
[dbo].[aspnet_Membership_FindUsersByEmail]
, you'll see (the default implementation) is already "separated by application". (because this procedure takes "ApplicationName" as a parameter.
So if you programmatically set the
MembershipProvider.ApplicationName
http://msdn.microsoft.com/en-us/library/system.web.security.membershipprovider.applicationname.aspx
Then you should be able to do what you want.
Here is the signature of the procedure mentioned above:
ALTER PROCEDURE [dbo].[aspnet_Membership_FindUsersByEmail]
@ApplicationName nvarchar(256),
@EmailToMatch nvarchar(256),
@PageIndex int,
@PageSize int
AS
REMINDER:
You do not deal with the stored procedures directly. You use the API of the MembershipProvider.
But here is the simple test.
MembershipProvider mp1 = Membership.Providers["App1"];
mp1.CreateUser (.................. )
MembershipProvider mp2 = Membership.Providers["App2"];
mp2.CreateUser (.................. ) /* use same email */
Now, I think you'll have to define each MembershipProvider (and its name) in your config file.
But here is an MSDN link:
http://msdn.microsoft.com/en-us/library/system.web.security.membershipprovidercollection.item.aspx