Esempio n. 1
0
        public IndexService()
        {
            memoryCacheManager = MemoryCacheManager.GetMemoryCacheManager();
            redisCacheManager  = RedisCacheManager.GetRedisCacheManager();

            userList = new List <User>();
            userList.Add(new Models.User
            {
                CreateTime = DateTime.Now,
                Id         = 1,
                Name       = "zhangsan",
                Picture    = "",
                UpdateTime = DateTime.Now
            });
            userList.Add(new Models.User
            {
                CreateTime = DateTime.Now,
                Id         = 2,
                Name       = "lisi",
                Picture    = "",
                UpdateTime = DateTime.Now
            });
            userList.Add(new Models.User
            {
                CreateTime = DateTime.Now,
                Id         = 3,
                Name       = "wangwu",
                Picture    = "",
                UpdateTime = DateTime.Now
            });

            blogList = new List <Blog>();
            blogList.Add(new Blog
            {
                Content    = "text blog by zhangsan",
                CreateBy   = 1,
                CreateTime = DateTime.Now,
                Id         = 1,
                Title      = "text blog by zhangsan",
                UpdateTime = DateTime.Now
            });
            blogList.Add(new Blog
            {
                Content    = "text blog by lisi",
                CreateBy   = 2,
                CreateTime = DateTime.Now,
                Id         = 2,
                Title      = "text blog by lisi",
                UpdateTime = DateTime.Now
            });
            blogList.Add(new Blog
            {
                Content    = "text blog by wangwu",
                CreateBy   = 3,
                CreateTime = DateTime.Now,
                Id         = 3,
                Title      = "text blog by wangwu",
                UpdateTime = DateTime.Now
            });

            commentList = new List <Models.Comment>();
            commentList.Add(new Models.Comment
            {
                BlogId     = 1,
                Content    = "text comment for zhangsan's blog ",
                CreateBy   = 2,
                CreateTime = DateTime.Now,
                Id         = 1
            });
        }