Esempio n. 1
0
        public List <StudentDto> GetAll(Expression <Func <Student, bool> > condition = null)
        {
            var studentList = new List <StudentDto>();
            var students    = _studentDal.GetList(condition);

            foreach (var item in students)
            {
                var student = new StudentDto()
                {
                    Id      = item.Id,
                    Name    = item.Name,
                    Surname = item.Surname,
                };

                studentList.Add(student);
            }
            return(studentList);
        }
Esempio n. 2
0
        public IActionResult Index()
        {
            if (_redisDatabase.KeyExists("studentList"))
            {
                var jsonStringData     = _redisDatabase.StringGet("studentList");
                var dataFromRedisCache = JsonSerializer.Deserialize <List <Student> >(jsonStringData);
                return(View(dataFromRedisCache));
            }

            else
            {
                var studentListFromDb = _studentDal.GetList();
                var jsonString        = JsonSerializer.Serialize(studentListFromDb);
                _redisDatabase.StringSet("studentList", jsonString);

                return(View(studentListFromDb));
            }
        }
Esempio n. 3
0
        public List <Student> GetAll()
        {
            var data = _mapper.Map <List <Student> >(_studentDal.GetList());

            return(data);
        }
Esempio n. 4
0
 public IDataResult <List <Student> > GetList()
 {
     return(new SuccessDataResult <List <Student> >(_IStudentDal.GetList().ToList()));
 }
 public List <Student> GetList()
 {
     return(new List <Student>(_studentDal.GetList().ToList()));
 }
Esempio n. 6
0
 public List <Student> GetAll()
 {
     return(_studentDal.GetList().ToList());
 }