public Asset(string mongodbConnStr, string mongodbDatabase, string assetID) { mongoHelper mh = new mongoHelper(); JArray JA = mh.GetData(mongodbConnStr, mongodbDatabase, "NEP5asset", "{assetid:'" + assetID + "'}"); JObject J = (JObject)JA[0]; assetid = (string)J["assetid"]; totalsupply = (string)J["totalsupply"]; name = (string)J["name"]; symbol = (string)J["symbol"]; decimals = (int)J["decimals"]; }
public ActionResult <IEnumerable <string> > Get() { try{ mongoHelper mh = new mongoHelper(); long blockCount = (long)(mh.GetData(mh.mongodbConnStr_testnet, mh.mongodbDatabase_testnet, "system_counter", "{counter:'block'}")[0]["lastBlockindex"]) + 1; return(new string[] { System.IO.Directory.GetCurrentDirectory().ToString(), "data1", "data2", blockCount.ToString() }); } catch (Exception ex) { return(new string[] { ex.Message }); } }