private string EvaluateScopedProperty(PropertyOwnerType scope, string name, string format)
        {
            //TODO: In the current implementation it makes no sense to pass a format
            //specification here, because user-defined properties are always stored
            //as strings. But in the future we might support typed properties such
            //as dates and numbers.

            //	The scope sub-cache is guaranteed to exist because we created it in
            //	LoadProperties, but the named property is not guaranteed to exist.
            string value = null;
            bool   found = _propertyCache[scope].TryGetValue(name, out value);

            return(value);
        }
        private void LoadProperties(PropertyOwnerType ownerType, string ownerId, string prefix)
        {
            Dictionary <string, string> subcache = _propertyCache[ownerType];

            List <Core.Domain.Property> props = _unitOfWork.Repository <Core.Domain.Property>()
                                                .Query(p => p.OwnerType == ownerType
                                                       &&
                                                       p.OwnerId == ownerId)
                                                .Get(false)
                                                .ToList();

            foreach (Core.Domain.Property prop in props)
            {
                subcache.Add(prop.Name, prop.Value);
            }
        }