ToObject() public static method

public static ToObject ( BsonValue value ) : object
value BsonValue
return object
Esempio n. 1
0
 public object this[int index]
 {
     get
     {
         return(Actor.ToObject(_array[index]));
     }
     set
     {
         _array[index] = Actor.ToBsonValue(value);
     }
 }
Esempio n. 2
0
 public bool TryGetValue(string key, out object value)
 {
     if (_document.TryGetValue(key, out BsonValue value2))
     {
         value = Actor.ToObject(value2);
         return(true);
     }
     else
     {
         value = null;
         return(false);
     }
 }
Esempio n. 3
0
 public object this[string key]
 {
     get
     {
         if (key == null)
         {
             throw new ArgumentNullException(nameof(key));
         }
         return(_document.TryGetValue(key, out BsonValue value) ? Actor.ToObject(value) : null);
     }
     set
     {
         if (key == null)
         {
             throw new ArgumentNullException(nameof(key));
         }
         _document.Set(key, Actor.ToBsonValue(value));
     }
 }
Esempio n. 4
0
 object IDictionary.this[object key]
 {
     get
     {
         if (key == null)
         {
             throw new ArgumentNullException(nameof(key));
         }
         return(_document.TryGetValue(key.ToString(), out BsonValue value) ? Actor.ToObject(value) : null);
     }
     set
     {
         if (key == null)
         {
             throw new ArgumentNullException(nameof(key));
         }
         _document.Set(key.ToString(), Actor.ToBsonValue(value));
     }
 }
Esempio n. 5
0
 public object this[object key]
 {
     get
     {
         if (key == null)
         {
             throw new ArgumentNullException("key");
         }
         BsonValue value;
         return(_document.TryGetValue(key.ToString(), out value) ? Actor.ToObject(value) : null);
     }
     set
     {
         if (key == null)
         {
             throw new ArgumentNullException("key");
         }
         _document.Set(key.ToString(), Actor.ToBsonValue(value));
     }
 }
Esempio n. 6
0
 static Expression ExistsExpression(Expression field, BsonValue args)
 {
     return(Expression.Equal(
                Expression.Call(Data, typeof(BsonDocument).GetMethod("Contains"), field),
                Expression.Constant(LanguagePrimitives.IsTrue(Actor.ToObject(args)), typeof(bool))));
 }