Class WolfCachedEntityCollectionExtensions
Extensions for IWolfCachedEntityCollection<TEntity>
Namespace: TehGM.Wolfringo.Caching.Internal
Assembly: Wolfringo.Core.dll
Syntax
public static class WolfCachedEntityCollectionExtensions
Methods
| Improve this Doc View SourceAddOrReplaceIfChanged<T>(IWolfCachedEntityCollection<T>, T)
Adds entity, or replaces it if the existing one changed.
Declaration
public static void AddOrReplaceIfChanged<T>(this IWolfCachedEntityCollection<T> cache, T item)
where T : IWolfEntity
Parameters
Type | Name | Description |
---|---|---|
IWolfCachedEntityCollection<T> | cache | Cache to add or replace item in. |
T | item | Item to add or replace. |
Type Parameters
Name | Description |
---|---|
T | Type of cached entity. |
Remarks
In case entity with same ID already exists, this method will compare existing entity with it's Equals method. If Equals returns true, the entity will not be replaced.