ToObject() public static method

public static ToObject ( BsonValue value ) : object
value BsonValue
return object
示例#1
0
 public object this[int index]
 {
     get
     {
         return(Actor.ToObject(_array[index]));
     }
     set
     {
         _array[index] = Actor.ToBsonValue(value);
     }
 }
示例#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);
     }
 }
示例#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));
     }
 }
示例#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));
     }
 }
示例#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));
     }
 }
示例#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))));
 }