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); }
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)); } }
public List <Student> GetAll() { var data = _mapper.Map <List <Student> >(_studentDal.GetList()); return(data); }
public IDataResult <List <Student> > GetList() { return(new SuccessDataResult <List <Student> >(_IStudentDal.GetList().ToList())); }
public List <Student> GetList() { return(new List <Student>(_studentDal.GetList().ToList())); }
public List <Student> GetAll() { return(_studentDal.GetList().ToList()); }