Beispiel #1
0
        public static PolicyRangePartition DeserializePolicyRangePartition(JObject json, Table target)
        {
            var tom = TOM.JsonSerializer.DeserializeObject <TOM.Partition>(json.ToString(Formatting.None));

            tom.Name = target.Partitions.GetNewName(tom.Name);
            var partition = PolicyRangePartition.CreateFromMetadata(target, tom);

            return(partition);
        }
Beispiel #2
0
 protected override object CreateInstance(Type itemType)
 {
     if (itemType == typeof(MPartition))
     {
         return(MPartition.CreateNew(table));
     }
     if (itemType == typeof(Partition))
     {
         return(Partition.CreateNew(table));
     }
     if (itemType == typeof(EntityPartition))
     {
         return(EntityPartition.CreateNew(table));
     }
     if (itemType == typeof(PolicyRangePartition))
     {
         return(PolicyRangePartition.CreateNew(table));
     }
     return(base.CreateInstance(itemType));
 }