/// <summary>
        /// Updates or inserts a stream in the local cache.
        /// </summary>
        /// <param name="stream"></param>
        /// <param name="restApi"></param>
        public static void AddOrUpdateStream(SpeckleStream stream, string restApi)
        {
            LocalContext.Init();
            var bytes        = SpeckleCore.Converter.getBytes(stream.ToJson());
            var combinedHash = Converter.getMd5Hash(stream._id + restApi);

            var cacheRes = Database.Table <CachedStream>().Where(existing => existing.CombinedHash == combinedHash).ToList();

            if (cacheRes.Count >= 1)
            {
                var toUpdate = cacheRes[0];
                toUpdate.Bytes     = bytes;
                toUpdate.UpdatedOn = DateTime.Now;
                Database.Update(toUpdate);
            }
            else
            {
                var toCache = new CachedStream()
                {
                    CombinedHash = combinedHash,
                    Bytes        = bytes,
                    RestApi      = restApi,
                    StreamId     = stream.StreamId,
                    AddedOn      = DateTime.Now,
                    UpdatedOn    = DateTime.Now
                };
                Database.Insert(toCache);
            }
            //throw new NotImplementedException();
        }