From cc853ff63171e5260a7bc8a5294238081190e153 Mon Sep 17 00:00:00 2001 From: Thomas Edward Kingstone Date: Tue, 26 Mar 2024 14:00:47 +0000 Subject: [PATCH] fixed BsonDocument not having 'this' keyword, and some doc compliance --- Mongo_Adapter/MongoAdapter.cs | 26 +++++++++++++------------- Mongo_Engine/Convert/Bson.cs | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Mongo_Adapter/MongoAdapter.cs b/Mongo_Adapter/MongoAdapter.cs index f42bd0f..7671dd0 100644 --- a/Mongo_Adapter/MongoAdapter.cs +++ b/Mongo_Adapter/MongoAdapter.cs @@ -41,13 +41,13 @@ public partial class MongoAdapter : BHoMAdapter /**** Constructors ****/ /***************************************************/ - [Description("Create an adapter to a Mongo database. Use this constructor if you have the name of the server hosting the database and its port number")] - [Input("serverName", "address of the server hosting the database. Will generally start with \"mongodb://\"")] - [Input("port", "port number used to access the database. This will generally be the number after the ':' at the end of the address of the database")] - [Input("databaseName", "name of the database itself")] - [Input("collectionName", "name of the collection you want to access inside that database")] - [Input("useHistory", "If true, will store a copy of the data pushed to Mongo in a separate collection. Data from the last 5 pushes is available there")] - [Output("adapter", "Adapter to Mongo Database")] + [Description("Create an adapter to a Mongo database. Use this constructor if you have the name of the server hosting the database and its port number.")] + [Input("serverName", "address of the server hosting the database. Will generally start with \"mongodb://\".")] + [Input("port", "port number used to access the database. This will generally be the number after the ':' at the end of the address of the database.")] + [Input("databaseName", "name of the database itself.")] + [Input("collectionName", "name of the collection you want to access inside that database.")] + [Input("useHistory", "If true, will store a copy of the data pushed to Mongo in a separate collection. Data from the last 5 pushes is available there.")] + [Output("adapter", "Adapter to Mongo Database.")] public MongoAdapter(string serverName = "mongodb://localhost", int port = 27017, string databaseName = "project", string collectionName = "bhomObjects", bool useHistory = true) { @@ -85,12 +85,12 @@ public MongoAdapter(string serverName = "mongodb://localhost", int port = 27017, /***************************************************/ - [Description("Create an adapter to a Mongo database. Use this constructor if you have a single long string representing the location of your database (and potentially identification)")] - [Input("connectionString", "Text given to you to access the database. Will generally start with \"mongodb://\"")] - [Input("databaseName", "name of the database itself")] - [Input("collectionName", "name of the collection you want to access inside that database")] - [Input("useHistory", "If true, will store a copy of the data pushed to Mongo in a separate collection. Data from the last 5 pushes is available there")] - [Output("adapter", "Adapter to Mongo Database")] + [Description("Create an adapter to a Mongo database. Use this constructor if you have a single long string representing the location of your database (and potentially identification).")] + [Input("connectionString", "Text given to you to access the database. Will generally start with \"mongodb://\".")] + [Input("databaseName", "name of the database itself.")] + [Input("collectionName", "name of the collection you want to access inside that database.")] + [Input("useHistory", "If true, will store a copy of the data pushed to Mongo in a separate collection. Data from the last 5 pushes is available there.")] + [Output("adapter", "Adapter to Mongo Database.")] public MongoAdapter(string connectionString, string databaseName = "project", string collectionName = "bhomObjects", bool useHistory = false) { diff --git a/Mongo_Engine/Convert/Bson.cs b/Mongo_Engine/Convert/Bson.cs index 02097b5..24bd9fb 100644 --- a/Mongo_Engine/Convert/Bson.cs +++ b/Mongo_Engine/Convert/Bson.cs @@ -53,7 +53,7 @@ public static BsonDocument ToBson(object obj, string tag) /*******************************************/ - public static object FromBson(BsonDocument document) + public static object FromBson(this BsonDocument document) { document.Remove("__Tag__"); document.Remove("__Time__");