public (HttpStatusCode StatusCode, RhinoEnvironmentModel Model) Get(Authentication authentication)
        {
            try
            {
                // ensure
                CreateCollection(authentication);

                // get environment
                var collection            = LiteDb.GetCollection <RhinoEnvironmentModel>(name: Collection);
                var environmentCollection = Get(name: Collection, collection);

                // not found
                if (environmentCollection.StatusCode == HttpStatusCode.NotFound)
                {
                    var onEnvironment = new RhinoEnvironmentModel
                    {
                        Environment = new ConcurrentDictionary <string, object>(),
                        Name        = Collection
                    };

                    return(HttpStatusCode.OK, onEnvironment);
                }

                // append
                var entity = Get(name: Collection, collection).Environment;

                // save
                return(HttpStatusCode.OK, entity);
            }
            catch (Exception e) when(e != null)
            {
                return(HttpStatusCode.InternalServerError, new RhinoEnvironmentModel());
            }
        }
        public void Test(Authentication authentication)
        {
            // ensure
            CreateCollection(authentication);

            // get environment
            var collection            = LiteDb.GetCollection <RhinoEnvironmentModel>(name: Collection);
            var environmentCollection = Get(name: Collection, collection);

            // not found
            if (environmentCollection.StatusCode == HttpStatusCode.NotFound)
            {
                var onEnvironment = new RhinoEnvironmentModel
                {
                    Environment = new ConcurrentDictionary <string, object>(),
                    Name        = Collection
                };

                collection.Insert(onEnvironment);
            }

            if (1 + 1 == 2)
            {
                var a = Get(name: Collection, collection);
            }
        }
        public HttpStatusCode Put(Authentication authentication, string name, string value)
        {
            try
            {
                // ensure
                CreateCollection(authentication);

                // get environment
                var collection            = LiteDb.GetCollection <RhinoEnvironmentModel>(name: Collection);
                var environmentCollection = Get(name: Collection, collection);

                // not found
                if (environmentCollection.StatusCode == HttpStatusCode.NotFound)
                {
                    var onEnvironment = new RhinoEnvironmentModel
                    {
                        Environment = new ConcurrentDictionary <string, object>(),
                        Name        = Collection
                    };

                    collection.Insert(onEnvironment);
                }

                // append
                var entity = Get(name: Collection, collection).Environment;
                entity.Environment[name] = value;

                // save
                collection.Update(entity);
                return(HttpStatusCode.OK);
            }
            catch (Exception e) when(e != null)
            {
                return(HttpStatusCode.InternalServerError);
            }
        }