示例#1
0
        public string BackupTask(dynamic obj)
        {
            string           h     = File.ReadAllText(HttpContext.Current.Server.MapPath("~/App_Data/" + obj.filename));
            List <WritaPost> posts = JsonConvert.DeserializeObject <List <WritaPost> >(h);

            _db.DeleteAllPosts();
            System.Threading.Thread.Sleep(1000);
            foreach (WritaPost p in posts)
            {
                _db.CreatePost(p);
            }

            return(obj.filename + " restored");
        }