예제 #1
0
        public static EntityPartition DeserializeEntityPartition(JObject json, Table target)
        {
            var tom = TOM.JsonSerializer.DeserializeObject <TOM.Partition>(json.ToString(Formatting.None));

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

            return(partition);
        }
 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));
     }
     return(base.CreateInstance(itemType));
 }