Esempio n. 1
0
 protected override void ValidateKey(PartitionedItemKey key)
 {
     base.ValidateKey(key);
     if (string.IsNullOrEmpty(key.PartitionKey))
     {
         throw new ArgumentNullException(nameof(key.PartitionKey));
     }
     if (string.IsNullOrEmpty(key.Id))
     {
         throw new ArgumentNullException(nameof(key.Id));
     }
 }
Esempio n. 2
0
        protected virtual PartitionedItemKey GetKeyFromEntity(TValue value)
        {
            var id = GetPropertyValue(value, "Id");
            var partitionKeyValue = GetPropertyValue(value, GetPartitionKey());

            var ky = new PartitionedItemKey
            {
                PartitionKey = partitionKeyValue,
                Id           = id
            };

            return(ky);
        }
Esempio n. 3
0
        protected virtual PartitionedItemKey GetKeyFromEntity(TValue value)
        {
            if (string.IsNullOrEmpty(value.Id))
            {
                throw new ArgumentNullException(nameof(value.Id));
            }
            var ky = new PartitionedItemKey
            {
                Id           = value.Id,
                PartitionKey = GetPropertyValue(value, GetPartitionKey())
            };

            return(ky);
        }
Esempio n. 4
0
 protected override PartitionedItemKey GetKeyFromKey(PartitionedItemKey key)
 {
     return(key);
 }