예제 #1
0
        public static UniqueKeyPolicy ToSDKModel(PSUniqueKeyPolicy pSUniqueKeyPolicy)
        {
            if (pSUniqueKeyPolicy == null)
            {
                return(null);
            }

            UniqueKeyPolicy uniqueKeyPolicy = new UniqueKeyPolicy
            {
                UniqueKeys = new List <UniqueKey>()
            };

            if (ModelHelper.IsNotNullOrEmpty(pSUniqueKeyPolicy.UniqueKeys))
            {
                foreach (PSUniqueKey uniqueKey in pSUniqueKeyPolicy.UniqueKeys)
                {
                    UniqueKey key = new UniqueKey
                    {
                        Paths = new List <string>(uniqueKey?.Paths)
                    };
                    uniqueKeyPolicy.UniqueKeys.Add(key);
                }
            }

            return(uniqueKeyPolicy);
        }
 public PSSqlContainerGetPropertiesResource(SqlContainerGetPropertiesResource sqlContainerGetPropertiesResource)
 {
     Id                       = sqlContainerGetPropertiesResource.Id;
     IndexingPolicy           = new PSIndexingPolicy(sqlContainerGetPropertiesResource.IndexingPolicy);
     PartitionKey             = new PSContainerPartitionKey(sqlContainerGetPropertiesResource.PartitionKey);
     DefaultTtl               = sqlContainerGetPropertiesResource.DefaultTtl;
     UniqueKeyPolicy          = new PSUniqueKeyPolicy(sqlContainerGetPropertiesResource.UniqueKeyPolicy);
     ConflictResolutionPolicy = new PSConflictResolutionPolicy(sqlContainerGetPropertiesResource.ConflictResolutionPolicy);
     _rid                     = sqlContainerGetPropertiesResource._rid;
     _ts                      = sqlContainerGetPropertiesResource._ts;
     _etag                    = sqlContainerGetPropertiesResource._etag;
 }
예제 #3
0
 public PSGremlinGraphGetPropertiesResource(GremlinGraphGetPropertiesResource gremlinGraphGetPropertiesResource)
 {
     Id                       = gremlinGraphGetPropertiesResource.Id;
     IndexingPolicy           = new PSIndexingPolicy(gremlinGraphGetPropertiesResource.IndexingPolicy);
     PartitionKey             = new PSContainerPartitionKey(gremlinGraphGetPropertiesResource.PartitionKey);
     DefaultTtl               = gremlinGraphGetPropertiesResource.DefaultTtl;
     UniqueKeyPolicy          = new PSUniqueKeyPolicy(gremlinGraphGetPropertiesResource.UniqueKeyPolicy);
     ConflictResolutionPolicy = new PSConflictResolutionPolicy(gremlinGraphGetPropertiesResource.ConflictResolutionPolicy);
     _rid                     = gremlinGraphGetPropertiesResource._rid;
     _ts                      = gremlinGraphGetPropertiesResource._ts;
     _etag                    = gremlinGraphGetPropertiesResource._etag;
 }
예제 #4
0
        public PSSqlContainerGetPropertiesResource(SqlContainerGetPropertiesResource sqlContainerGetPropertiesResource)
        {
            if (sqlContainerGetPropertiesResource == null)
            {
                return;
            }

            Id                       = sqlContainerGetPropertiesResource.Id;
            IndexingPolicy           = new PSIndexingPolicy(sqlContainerGetPropertiesResource.IndexingPolicy);
            PartitionKey             = new PSContainerPartitionKey(sqlContainerGetPropertiesResource.PartitionKey);
            DefaultTtl               = sqlContainerGetPropertiesResource.DefaultTtl;
            UniqueKeyPolicy          = new PSUniqueKeyPolicy(sqlContainerGetPropertiesResource.UniqueKeyPolicy);
            ConflictResolutionPolicy = new PSConflictResolutionPolicy(sqlContainerGetPropertiesResource.ConflictResolutionPolicy);
            AnalyticalStorageTtl     = (int?)sqlContainerGetPropertiesResource.AnalyticalStorageTtl;
            _rid                     = sqlContainerGetPropertiesResource._rid;
            _ts                      = sqlContainerGetPropertiesResource._ts;
            _etag                    = sqlContainerGetPropertiesResource._etag;
        }
예제 #5
0
        public static UniqueKeyPolicy ConvertPSUniqueKeyPolicyToUniqueKeyPolicy(PSUniqueKeyPolicy pSUniqueKeyPolicy)
        {
            UniqueKeyPolicy uniqueKeyPolicy = new UniqueKeyPolicy
            {
                UniqueKeys = new List <UniqueKey>()
            };

            foreach (PSUniqueKey uniqueKey in pSUniqueKeyPolicy?.UniqueKeys)
            {
                UniqueKey key = new UniqueKey
                {
                    Paths = new List <string>(uniqueKey.Paths)
                };
                uniqueKeyPolicy.UniqueKeys.Add(key);
            }

            return(uniqueKeyPolicy);
        }