Пример #1
0
        public object PackCompoundKey(string kind, IReadOnlyList <object> components)
        {
            var result = new CompoundKey();
            var names  = GetKeyNames(kind);

            for (var i = 0; i < components.Count; i++)
            {
                result[names[i]] = components[i];
            }

            return(result);
        }
Пример #2
0
        public object GetKey(string kind, IDictionary <string, object> data)
        {
            var keyNames = GetKeyNames(kind);

            if (keyNames.Count <= 1)
            {
                return(data.GetSafe(keyNames.First()));
            }

            var key = new CompoundKey();

            foreach (var name in keyNames)
            {
                key[name] = data.GetSafe(name);
            }

            return(key);
        }