TeamFoundationCacheService<TKey, TValue> Class

A base class that can be used to implement an in-memory cache service.

This class provides thread safe get/add methods, implements ITeamFoundationService and cleanup scheduling.

Derived class must implement a cleanup logic.

Inheritance Hierarchy

Microsoft.TeamFoundation.Framework.Server.TeamFoundationCacheService<TKey, TValue>

Namespace: Microsoft.TeamFoundation.Framework.Server
Assembly: Microsoft.TeamFoundation.Framework.Server (in Microsoft.TeamFoundation.Framework.Server.dll)


<TeamFoundationServiceDependency(GetType(TeamFoundationTaskService))> _
Public MustInherit Class TeamFoundationCacheService(Of TKey, TValue) _
    Implements ITeamFoundationService
public abstract class TeamFoundationCacheService<TKey, TValue> : ITeamFoundationService
generic<typename TKey, typename TValue>
public ref class TeamFoundationCacheService abstract : ITeamFoundationService
type TeamFoundationCacheService<'TKey, 'TValue> =  
        interface ITeamFoundationService 
JScript does not support generic types or methods.

Type Parameters

  • TKey
  • TValue

The TeamFoundationCacheService<TKey, TValue> type exposes the following members.


Name Description
Protected method TeamFoundationCacheService<TKey, TValue> Initializes a new instance of TeamFoundationCacheService class.



Name Description
Public method Add Adds an item to the cache. If an item with the specified key already occurs in the cached, then new item is not added to the dictionary and the method return an item that is already in a cache.
Public method BulkRemove
Public method BulkSet
Public method Clear Removes all items from the cache. This method is thread safe.
Protected method DoCleanup
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method GetValues
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method Remove
Public method Set
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method TryGetValue Gets the value associated with the specified key.


Explicit Interface Implementations

Name Description
Explicit interface implemetationPrivate method ITeamFoundationService.ServiceEnd This method is called when the service is stopped.
Explicit interface implemetationPrivate method ITeamFoundationService.ServiceStart Starts the service.


Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also


Microsoft.TeamFoundation.Framework.Server Namespace