Exemple #1
0
        public RepositoryKey(IRepository repository, ObjectKey key)
            : base(key.RecordId, $"{repository.Name}:{key.FullKey}")
        {
            if (key == null)
            {
                throw new ArgumentNullException(nameof(key));
            }

            Repository = repository;
        }
Exemple #2
0
        private SimpleKey(string repository, ObjectKey objectKey)
            : base(objectKey.RecordId, repository + ":" + objectKey.FullKey)
        {
            if (string.IsNullOrEmpty(repository))
            {
                throw new ArgumentException("Value cannot be null or empty.", nameof(repository));
            }

            ObjectKey = objectKey;
        }
Exemple #3
0
        public static SimpleKey GenerateKey(string repository, string objectName)
        {
            if (string.IsNullOrEmpty(repository))
            {
                throw new ArgumentException("Value cannot be null or empty.", nameof(repository));
            }

            if (string.IsNullOrEmpty(objectName))
            {
                throw new ArgumentException("Value cannot be null or empty.", nameof(objectName));
            }

            var objectKey = new ObjectKey(objectName);

            return(new SimpleKey(repository, objectKey));
        }