Exemplo 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);
        }
Exemplo 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));
            }
        }
Exemplo n.º 3
0
        public List <Student> GetAll()
        {
            var data = _mapper.Map <List <Student> >(_studentDal.GetList());

            return(data);
        }
Exemplo 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()));
 }
Exemplo n.º 6
0
 public List <Student> GetAll()
 {
     return(_studentDal.GetList().ToList());
 }