/// <summary> /// Writes a BSON ObjectId to the writer. /// </summary> /// <param name="objectId">The ObjectId.</param> public override void WriteObjectId(ObjectId objectId) { if (Disposed) { throw new ObjectDisposedException("BsonBinaryWriter"); } if (State != BsonWriterState.Value) { ThrowInvalidState("WriteObjectId", BsonWriterState.Value); } _bsonStream.WriteBsonType(BsonType.ObjectId); WriteNameHelper(); _bsonStream.WriteObjectId(objectId); State = GetNextState(); }
static int _m_WriteObjectId(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); MongoDB.Bson.IO.BsonStream gen_to_be_invoked = (MongoDB.Bson.IO.BsonStream)translator.FastGetCSObj(L, 1); { MongoDB.Bson.ObjectId _value; translator.Get(L, 2, out _value); gen_to_be_invoked.WriteObjectId(_value); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }