How to store the ambiguous "object" used as key to Membership records
The ASP.NET Membership API calls for System.Object to the be the type used as the ProviderUserKey. This way, your provider can use whatever you'd like as the key field for your user records. The built-in SQL Server provider, for example, uses a Guid.
The provider I wrote uses an int instead. That part doesn't concern me... it's what I use in other calling code. For example, I might have an Orders table that is associated with Membership users. But how do I keep it provider agnostic? Sure, the object representation in .NET can simple be System.Object, but when it's time to store something in that Orders table, how do I get object to the database?
Any suggestions?