private CacheKey GenerateCacheKeyForEvict(object id, IType type, string entityOrRoleName) { // if there is a session context, use that to generate the key. if (CurrentSessionContext != null) { return(CurrentSessionContext .CurrentSession() .GetSessionImplementation() .GenerateCacheKey(id, type, entityOrRoleName)); } return(new CacheKey(id, type, entityOrRoleName, EntityMode.Poco, this)); }