Class CatalogIdentityResolver

Class to resolve catalog item code-id map.

Inheritance
System.Object
CatalogIdentityResolver
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.Catalog
Assembly: Mediachase.Commerce.dll
Version: 10.8.0
Syntax
public abstract class CatalogIdentityResolver

Constructors

CatalogIdentityResolver(ISynchronizedObjectInstanceCache)

Initializes a new instance of the CatalogIdentityResolver class.

Declaration
protected CatalogIdentityResolver(ISynchronizedObjectInstanceCache cache)
Parameters
Type Name Description
EPiServer.Framework.Cache.ISynchronizedObjectInstanceCache cache

The cache.

Properties

CachePrefix

Gets the cache prefix.

Declaration
protected virtual string CachePrefix { get; }
Property Value
Type Description
System.String

The cache prefix.

Methods

GetCode(Int32)

Gets the code.

Declaration
protected virtual string GetCode(int id)
Parameters
Type Name Description
System.Int32 id

The identifier.

Returns
Type Description
System.String

GetCodes(IEnumerable<Int32>)

Gets the code from list of id.

Declaration
protected virtual IDictionary<int, string> GetCodes(IEnumerable<int> ids)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Int32> ids

The list of identifiers.

Returns
Type Description
System.Collections.Generic.IDictionary<System.Int32, System.String>

GetCodesByIds(IEnumerable<Int32>)

Gets codes from the list of id.

Declaration
public virtual IDictionary<int, string> GetCodesByIds(IEnumerable<int> ids)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.Int32> ids

The list of id.

Returns
Type Description
System.Collections.Generic.IDictionary<System.Int32, System.String>

GetId(String)

Gets the identifier.

Declaration
protected virtual int? GetId(string code)
Parameters
Type Name Description
System.String code

The code.

Returns
Type Description
System.Nullable<System.Int32>

GetIds(IEnumerable<String>)

Gets the identifiers from list of code.

Declaration
protected virtual IDictionary<string, int> GetIds(IEnumerable<string> codes)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.String> codes

The list of code.

Returns
Type Description
System.Collections.Generic.IDictionary<System.String, System.Int32>

GetIdsByCodes(IEnumerable<String>)

Gets ids from the list of code.

Declaration
public virtual IDictionary<string, int> GetIdsByCodes(IEnumerable<string> codes)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.String> codes

The list of code.

Returns
Type Description
System.Collections.Generic.IDictionary<System.String, System.Int32>

GetIdsFromCache(IEnumerable<String>)

Get catalog IDs from catalog codes by cache lookup.

Declaration
protected IDictionary<string, int> GetIdsFromCache(IEnumerable<string> codes)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.String> codes

A list of catalog codes.

Returns
Type Description
System.Collections.Generic.IDictionary<System.String, System.Int32>

A dictionary mapping from catalog code to catalog id.

GetIdsFromDatabase(IEnumerable<String>)

Get catalog IDs from catalog codes by database lookup.

Declaration
[Obsolete("This method is no longer used. Will remain at least until November 2017.")]
protected IDictionary<string, int> GetIdsFromDatabase(IEnumerable<string> codes)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.String> codes

A list of catalog codes.

Returns
Type Description
System.Collections.Generic.IDictionary<System.String, System.Int32>

A dictionary mapping from catalog code to catalaog id.

TryResolve(Int32, out String)

Tries to resolve code from id.

Declaration
public virtual bool TryResolve(int id, out string foundCode)
Parameters
Type Name Description
System.Int32 id

The identifier.

System.String foundCode

The found code.

Returns
Type Description
System.Boolean

TryResolve(String, out Int32)

Tries to resolve id from code.

Declaration
public virtual bool TryResolve(string code, out int foundId)
Parameters
Type Name Description
System.String code

The code.

System.Int32 foundId

The found identifier.

Returns
Type Description
System.Boolean