/// <summary> /// Gets (or constructs) the FilterAttributeCache for the database in question. /// A typical application will only have one FilterAttributeCache for its lifetime, /// but it is possible to be running FrameLog on multiple databases simultaneously. /// We use the IFrameLogContext.UnderlyingType to create one FilterAttributeCache per /// database-type. /// </summary> internal static FilterAttributeCache For(IFrameLogContext context) { var id = context.UnderlyingContextType; lock (caches) { FilterAttributeCache filter; if (!caches.TryGetValue(id, out filter)) { filter = caches[id] = new FilterAttributeCache(context.Workspace); } return filter; } }
public AttributeBasedLoggingFilter(ContextInfo context) { cache = FilterAttributeCache.For(context); }
public AttributeBasedLoggingFilter(IFrameLogContext context) { cache = FilterAttributeCache.For(context); }