public static T Get <T>(IResource res, ResourceTypeId <T> resourceTypeId) where T : BusinessObject { lock (_cache) { WeakReference reference; if (_cache.TryGetValue(res.Id, out reference)) { object target = reference.Target; if (target != null) { return((T)target); } } T result = resourceTypeId.CreateBusinessObject(res); _cache[res.Id] = new WeakReference(result); return(result); } }
public BusinessObjectEnumerator(ResourceTypeId <T> resourceType, IEnumerator idEnumerator) { _resourceType = resourceType; _resourceEnumerator = idEnumerator; }
public BusinessObjectList(ResourceTypeId <T> resourceTypeId, IResourceList baseList) { _resourceTypeId = resourceTypeId; _baseList = baseList; }