Ejemplo n.º 1
0
        public object Clone()
        {
            PartitionKeyConfigurationAttribute partitionKeyAttribute = new PartitionKeyConfigurationAttribute();

            partitionKeyAttribute.Name = _name;
            partitionKeyAttribute.Type = _type;
            return(partitionKeyAttribute);
        }
Ejemplo n.º 2
0
        public static void ValidateConfiguration(PartitionKeyConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new Exception("PartitionKey Configuration cannot be null.");
            }

            foreach (var pair in configuration.PartitionKeyAttributes)
            {
                if (pair.Key == null)
                {
                    throw new Exception("ParitionKey Attribute Key cannot be null.");
                }
                if (pair.Key.Trim() == "")
                {
                    throw new Exception("PartitionKey Attribute Key cannot be empty string.");
                }

                PartitionKeyConfigurationAttribute.ValidateConfiguration(pair.Value);
            }
        }
Ejemplo n.º 3
0
 public static void ValidateConfiguration(PartitionKeyConfigurationAttribute configuration)
 {
     if (configuration == null)
     {
         throw new Exception("PartitionKey Attribute cannot be null.");
     }
     else if (configuration.Name == null)
     {
         throw new Exception("PartitionKey Attribute Name cannot be null.");
     }
     else if (configuration.Name.Trim() == "")
     {
         throw new Exception("PartitionKey Attribut Name cannot be empty string.");
     }
     else if (configuration.Type == null)
     {
         throw new Exception("PartitionKey Attribute Type cannot be null.");
     }
     else if (configuration.Type.Trim() == "")
     {
         throw new Exception("PartitionKey Attribut Type cannot be empty string.");
     }
 }