public Student Update(Student student)
 {
     var entry = db.Entry(student);
     entry.State = EntityState.Modified;
     db.SaveChanges();
     return entry.Entity;
 }
        public void Initialize()
        {
            RedisSeedDatabase();

            _repository = new StudentRedisRepository();

            _student = new Student
            {
                Id = redisStudents.GetNextSequence(),
                Name = "Rogerio Sá de Lima",
                Age = 35,
                Birthday = new DateTime(1980, 10, 31),
                Actived = true
            };
        }
        private void RedisSeedDatabase()
        {
            redis.FlushAll();

            redisStudents = redis.As<Student>();

            var persistedStudent = new Student
            {
                Id = redisStudents.GetNextSequence(),
                Name = "Hugo Estevam Longo",
                Age = 30,
                Birthday = new DateTime(1985, 10, 31),
                Actived = true
            };

            redisStudents.Store(persistedStudent);
        }
 public Student Update(Student student)
 {
     return redisStudents.Store(student);
 }
 public Student Add(Student student)
 {
     return redisStudents.Store(student);
 }
 public Student Add(Student student)
 {
     var std = db.Students.Add(student);
     db.SaveChanges();
     return std;
 }