static int _m_TryGetValue(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                MongoDB.Bson.RawBsonDocument gen_to_be_invoked = (MongoDB.Bson.RawBsonDocument)translator.FastGetCSObj(L, 1);



                {
                    string _name = LuaAPI.lua_tostring(L, 2);
                    MongoDB.Bson.BsonValue _value;

                    bool gen_ret = gen_to_be_invoked.TryGetValue(_name, out _value);
                    LuaAPI.lua_pushboolean(L, gen_ret);
                    translator.Push(L, _value);



                    return(2);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 2 && translator.Assignable <MongoDB.Bson.IO.IByteBuffer>(L, 2))
                {
                    MongoDB.Bson.IO.IByteBuffer _slice = (MongoDB.Bson.IO.IByteBuffer)translator.GetObject(L, 2, typeof(MongoDB.Bson.IO.IByteBuffer));

                    MongoDB.Bson.RawBsonDocument gen_ret = new MongoDB.Bson.RawBsonDocument(_slice);
                    translator.Push(L, gen_ret);

                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
                {
                    byte[] _bytes = LuaAPI.lua_tobytes(L, 2);

                    MongoDB.Bson.RawBsonDocument gen_ret = new MongoDB.Bson.RawBsonDocument(_bytes);
                    translator.Push(L, gen_ret);

                    return(1);
                }
            }
            catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to MongoDB.Bson.RawBsonDocument constructor!"));
        }
        static int _g_get_Values(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                MongoDB.Bson.RawBsonDocument gen_to_be_invoked = (MongoDB.Bson.RawBsonDocument)translator.FastGetCSObj(L, 1);
                translator.PushAny(L, gen_to_be_invoked.Values);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
        static int _m_Add(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                MongoDB.Bson.RawBsonDocument gen_to_be_invoked = (MongoDB.Bson.RawBsonDocument)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 2 && translator.Assignable <MongoDB.Bson.BsonElement>(L, 2))
                {
                    MongoDB.Bson.BsonElement _element; translator.Get(L, 2, out _element);

                    MongoDB.Bson.BsonDocument gen_ret = gen_to_be_invoked.Add(_element);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && translator.Assignable <MongoDB.Bson.BsonValue>(L, 3))
                {
                    string _name = LuaAPI.lua_tostring(L, 2);
                    MongoDB.Bson.BsonValue _value = (MongoDB.Bson.BsonValue)translator.GetObject(L, 3, typeof(MongoDB.Bson.BsonValue));

                    MongoDB.Bson.BsonDocument gen_ret = gen_to_be_invoked.Add(_name, _value);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 4 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && translator.Assignable <MongoDB.Bson.BsonValue>(L, 3) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 4))
                {
                    string _name = LuaAPI.lua_tostring(L, 2);
                    MongoDB.Bson.BsonValue _value = (MongoDB.Bson.BsonValue)translator.GetObject(L, 3, typeof(MongoDB.Bson.BsonValue));
                    bool _condition = LuaAPI.lua_toboolean(L, 4);

                    MongoDB.Bson.BsonDocument gen_ret = gen_to_be_invoked.Add(_name, _value, _condition);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to MongoDB.Bson.RawBsonDocument.Add!"));
        }
        static int _m_GetValue(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                MongoDB.Bson.RawBsonDocument gen_to_be_invoked = (MongoDB.Bson.RawBsonDocument)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
                {
                    int _index = LuaAPI.xlua_tointeger(L, 2);

                    MongoDB.Bson.BsonValue gen_ret = gen_to_be_invoked.GetValue(_index);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
                {
                    string _name = LuaAPI.lua_tostring(L, 2);

                    MongoDB.Bson.BsonValue gen_ret = gen_to_be_invoked.GetValue(_name);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && translator.Assignable <MongoDB.Bson.BsonValue>(L, 3))
                {
                    string _name = LuaAPI.lua_tostring(L, 2);
                    MongoDB.Bson.BsonValue _defaultValue = (MongoDB.Bson.BsonValue)translator.GetObject(L, 3, typeof(MongoDB.Bson.BsonValue));

                    MongoDB.Bson.BsonValue gen_ret = gen_to_be_invoked.GetValue(_name, _defaultValue);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to MongoDB.Bson.RawBsonDocument.GetValue!"));
        }
        static int _m_Dispose(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                MongoDB.Bson.RawBsonDocument gen_to_be_invoked = (MongoDB.Bson.RawBsonDocument)translator.FastGetCSObj(L, 1);



                {
                    gen_to_be_invoked.Dispose(  );



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        public static int __NewIndexer(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                if (translator.Assignable <MongoDB.Bson.RawBsonDocument>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable <MongoDB.Bson.BsonValue>(L, 3))
                {
                    MongoDB.Bson.RawBsonDocument gen_to_be_invoked = (MongoDB.Bson.RawBsonDocument)translator.FastGetCSObj(L, 1);
                    int key = LuaAPI.xlua_tointeger(L, 2);
                    gen_to_be_invoked[key] = (MongoDB.Bson.BsonValue)translator.GetObject(L, 3, typeof(MongoDB.Bson.BsonValue));
                    LuaAPI.lua_pushboolean(L, true);
                    return(1);
                }
            }
            catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            LuaAPI.lua_pushboolean(L, false);
            return(1);
        }
        static int _m_SetElement(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                MongoDB.Bson.RawBsonDocument gen_to_be_invoked = (MongoDB.Bson.RawBsonDocument)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 2 && translator.Assignable <MongoDB.Bson.BsonElement>(L, 2))
                {
                    MongoDB.Bson.BsonElement _element; translator.Get(L, 2, out _element);

                    MongoDB.Bson.BsonDocument gen_ret = gen_to_be_invoked.SetElement(_element);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 3 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && translator.Assignable <MongoDB.Bson.BsonElement>(L, 3))
                {
                    int _index = LuaAPI.xlua_tointeger(L, 2);
                    MongoDB.Bson.BsonElement _element; translator.Get(L, 3, out _element);

                    MongoDB.Bson.BsonDocument gen_ret = gen_to_be_invoked.SetElement(_index, _element);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to MongoDB.Bson.RawBsonDocument.SetElement!"));
        }
        static int _m_Merge(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                MongoDB.Bson.RawBsonDocument gen_to_be_invoked = (MongoDB.Bson.RawBsonDocument)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 2 && translator.Assignable <MongoDB.Bson.BsonDocument>(L, 2))
                {
                    MongoDB.Bson.BsonDocument _document = (MongoDB.Bson.BsonDocument)translator.GetObject(L, 2, typeof(MongoDB.Bson.BsonDocument));

                    MongoDB.Bson.BsonDocument gen_ret = gen_to_be_invoked.Merge(_document);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 3 && translator.Assignable <MongoDB.Bson.BsonDocument>(L, 2) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3))
                {
                    MongoDB.Bson.BsonDocument _document = (MongoDB.Bson.BsonDocument)translator.GetObject(L, 2, typeof(MongoDB.Bson.BsonDocument));
                    bool _overwriteExistingElements     = LuaAPI.lua_toboolean(L, 3);

                    MongoDB.Bson.BsonDocument gen_ret = gen_to_be_invoked.Merge(_document, _overwriteExistingElements);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to MongoDB.Bson.RawBsonDocument.Merge!"));
        }
        static int _m_GetEnumerator(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                MongoDB.Bson.RawBsonDocument gen_to_be_invoked = (MongoDB.Bson.RawBsonDocument)translator.FastGetCSObj(L, 1);



                {
                    System.Collections.Generic.IEnumerator <MongoDB.Bson.BsonElement> gen_ret = gen_to_be_invoked.GetEnumerator(  );
                    translator.PushAny(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        static int _m_set_Item(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                MongoDB.Bson.RawBsonDocument gen_to_be_invoked = (MongoDB.Bson.RawBsonDocument)translator.FastGetCSObj(L, 1);



                {
                    string key = LuaAPI.lua_tostring(L, 2);
                    gen_to_be_invoked[key] = (MongoDB.Bson.BsonValue)translator.GetObject(L, 3, typeof(MongoDB.Bson.BsonValue));



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        static int _m_RemoveElement(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                MongoDB.Bson.RawBsonDocument gen_to_be_invoked = (MongoDB.Bson.RawBsonDocument)translator.FastGetCSObj(L, 1);



                {
                    MongoDB.Bson.BsonElement _element; translator.Get(L, 2, out _element);

                    gen_to_be_invoked.RemoveElement(_element);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        static int _m_Materialize(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                MongoDB.Bson.RawBsonDocument gen_to_be_invoked = (MongoDB.Bson.RawBsonDocument)translator.FastGetCSObj(L, 1);



                {
                    MongoDB.Bson.IO.BsonBinaryReaderSettings _binaryReaderSettings = (MongoDB.Bson.IO.BsonBinaryReaderSettings)translator.GetObject(L, 2, typeof(MongoDB.Bson.IO.BsonBinaryReaderSettings));

                    MongoDB.Bson.BsonDocument gen_ret = gen_to_be_invoked.Materialize(_binaryReaderSettings);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        static int _m_ContainsValue(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                MongoDB.Bson.RawBsonDocument gen_to_be_invoked = (MongoDB.Bson.RawBsonDocument)translator.FastGetCSObj(L, 1);



                {
                    MongoDB.Bson.BsonValue _value = (MongoDB.Bson.BsonValue)translator.GetObject(L, 2, typeof(MongoDB.Bson.BsonValue));

                    bool gen_ret = gen_to_be_invoked.ContainsValue(_value);
                    LuaAPI.lua_pushboolean(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        static int _m_AddRange(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                MongoDB.Bson.RawBsonDocument gen_to_be_invoked = (MongoDB.Bson.RawBsonDocument)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 2 && translator.Assignable <System.Collections.Generic.Dictionary <string, object> >(L, 2))
                {
                    System.Collections.Generic.Dictionary <string, object> _dictionary = (System.Collections.Generic.Dictionary <string, object>)translator.GetObject(L, 2, typeof(System.Collections.Generic.Dictionary <string, object>));

                    MongoDB.Bson.BsonDocument gen_ret = gen_to_be_invoked.AddRange(_dictionary);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && translator.Assignable <System.Collections.IDictionary>(L, 2))
                {
                    System.Collections.IDictionary _dictionary = (System.Collections.IDictionary)translator.GetObject(L, 2, typeof(System.Collections.IDictionary));

                    MongoDB.Bson.BsonDocument gen_ret = gen_to_be_invoked.AddRange(_dictionary);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && translator.Assignable <System.Collections.Generic.IEnumerable <MongoDB.Bson.BsonElement> >(L, 2))
                {
                    System.Collections.Generic.IEnumerable <MongoDB.Bson.BsonElement> _elements = (System.Collections.Generic.IEnumerable <MongoDB.Bson.BsonElement>)translator.GetObject(L, 2, typeof(System.Collections.Generic.IEnumerable <MongoDB.Bson.BsonElement>));

                    MongoDB.Bson.BsonDocument gen_ret = gen_to_be_invoked.AddRange(_elements);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && translator.Assignable <System.Collections.Generic.IEnumerable <System.Collections.Generic.KeyValuePair <string, object> > >(L, 2))
                {
                    System.Collections.Generic.IEnumerable <System.Collections.Generic.KeyValuePair <string, object> > _dictionary = (System.Collections.Generic.IEnumerable <System.Collections.Generic.KeyValuePair <string, object> >)translator.GetObject(L, 2, typeof(System.Collections.Generic.IEnumerable <System.Collections.Generic.KeyValuePair <string, object> >));

                    MongoDB.Bson.BsonDocument gen_ret = gen_to_be_invoked.AddRange(_dictionary);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to MongoDB.Bson.RawBsonDocument.AddRange!"));
        }