static public MongoIndexOptions CovertPSMongoIndexOptionsToMongoIndexOptions(PSMongoIndexOptions psMongoIndexOptions)
 {
     return(new MongoIndexOptions
     {
         ExpireAfterSeconds = psMongoIndexOptions.ExpireAfterSeconds,
         Unique = psMongoIndexOptions.Unique
     });
 }
        public PSMongoIndex(MongoIndex mongoIndex)
        {
            if (mongoIndex == null)
            {
                return;
            }

            Key     = new PSMongoIndexKeys(mongoIndex.Key);
            Options = new PSMongoIndexOptions(mongoIndex.Options);
        }
        static public MongoIndexOptions ToSDKModel(PSMongoIndexOptions psMongoIndexOptions)
        {
            if (psMongoIndexOptions == null)
            {
                return(null);
            }

            return(new MongoIndexOptions
            {
                ExpireAfterSeconds = psMongoIndexOptions.ExpireAfterSeconds,
                Unique = psMongoIndexOptions.Unique
            });
        }
Exemple #4
0
        static public MongoIndex ConvertPSMongoIndexToMongoIndex(PSMongoIndex psMongoIndex)
        {
            MongoIndex mongoIndex = new MongoIndex();

            if (psMongoIndex.Key != null)
            {
                mongoIndex.Key = PSMongoIndexKeys.ConvertPSMongoIndexKeysToMongoIndexKeys(psMongoIndex.Key);
            }

            if (psMongoIndex.Options != null)
            {
                mongoIndex.Options = PSMongoIndexOptions.CovertPSMongoIndexOptionsToMongoIndexOptions(psMongoIndex.Options);
            }

            return(mongoIndex);
        }
        static public MongoIndex ToSDKModel(PSMongoIndex psMongoIndex)
        {
            if (psMongoIndex == null)
            {
                return(null);
            }

            MongoIndex mongoIndex = new MongoIndex();

            if (psMongoIndex.Key != null)
            {
                mongoIndex.Key = PSMongoIndexKeys.ToSDKModel(psMongoIndex.Key);
            }

            if (psMongoIndex.Options != null)
            {
                mongoIndex.Options = PSMongoIndexOptions.ToSDKModel(psMongoIndex.Options);
            }

            return(mongoIndex);
        }
Exemple #6
0
 public PSMongoIndex(MongoIndex mongoIndex)
 {
     Key     = new PSMongoIndexKeys(mongoIndex.Key);
     Options = new PSMongoIndexOptions(mongoIndex.Options);
 }