コード例 #1
0
        public virtual async Task <T> GetAsync(Guid guid)
        {
            string fileName = this.GetFileName(guid);
            var    json     = await _fileManager.GetTextFileAsync(fileName);

            var item = JsonConvert.DeserializeObject <T>(json);

            return(item);
        }
コード例 #2
0
        public virtual async Task <Site> GetAsync()
        {
            if (await _fileManager.FileExistsAsync("site.json") == false)
            {
                return(new Site());
            }

            var json = await _fileManager.GetTextFileAsync("site.json");

            var item = JsonConvert.DeserializeObject <Site>(json);

            return(item);
        }