Class MapUserKey

Manages mapping of ProviderUserKey to/from string representation.

Inheritance
System.Object
MapUserKey
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.Commerce.Customers
Assembly: Mediachase.Commerce.dll
Version: 10.8.0
Syntax
public class MapUserKey

Constructors

MapUserKey()

Initializes a new instance of the MapUserKey class with the registered IUserKeyConverter implementations from EPiServer.ServiceLocation.ServiceLocator.

Declaration
public MapUserKey()

MapUserKey(IEnumerable<IUserKeyConverter>)

Initializes a new instance of the MapUserKey class.

Declaration
public MapUserKey(IEnumerable<IUserKeyConverter> converters)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<IUserKeyConverter> converters

The user key converters.

MapUserKey(Func<String, IConvertUserKey>)

Initializes a new instance of the MapUserKey class.

Declaration
[Obsolete("Use constructor with collection of IUserKeyConverter instances. Will remain at least until June 2016.")]
public MapUserKey(Func<string, IConvertUserKey> legacyConverterFactory)
Parameters
Type Name Description
System.Func<System.String, IConvertUserKey> legacyConverterFactory

Factory exprssion to get legacy converter.

Methods

GetUserKeyConverter(String)

Gets a converter for user key of specified type.

Declaration
protected virtual IUserKeyConverter GetUserKeyConverter(string typeName)
Parameters
Type Name Description
System.String typeName

Name of the type.

Returns
Type Description
IUserKeyConverter

A matching implementation of the IUserKeyConverter, or null if none is found.

ToTypedString(Object)

Converts a ProviderUserKey to string with embedded type information.

Declaration
public virtual string ToTypedString(object userKey)
Parameters
Type Name Description
System.Object userKey

The user key.

Returns
Type Description
System.String

A string that can be used as input to the ToUserKey method.

ToUserKey(String)

Converts a string to a provider user key.

Declaration
public virtual object ToUserKey(string typedUserKey)
Parameters
Type Name Description
System.String typedUserKey

The typed user key.

Returns
Type Description
System.Object

An object that can be used as ProviderUserKey for a membership provider.

UserKeyConverter(String)

Gets a converter for user key of specified type.

Declaration
[Obsolete("Converters should be reimplemented as IUserKeyConverter which are returned from GetUserKeyConverter method.  Will remain at least until June 2016.")]
protected virtual IConvertUserKey UserKeyConverter(string typeName)
Parameters
Type Name Description
System.String typeName

Name of the type.

Returns
Type Description
IConvertUserKey

An IConvertUserKey implementation for the requested type.

Exceptions
Type Condition
System.InvalidOperationException

A request is made for a type that has no registered converter.