public void AddReservation(string userId, int roomId, DateTime beginTime, DateTime endTime, string purpose)
        {
            var room = _context.Rooms.Where(a => a.Id == roomId).ToList();

            var res = new Reservation()
            {
                AspNetUserId = userId,
                BeginTime = beginTime,
                EndTime = endTime,
                RoomId = room[0].Id,
                Purpose = purpose
            };

            _context.Reservations.Add(res);
            _context.SaveChanges();
        }
        public async Task<ActionResult> Index()
        {

            Logger.Instance.Write("Getting reservations from DB...");
            Reservation[,] resArr = new Reservation[15,8];
            IEnumerable<Reservation> res = null;
            await Task.Run(()=>
            {
               res = _repository.GetReservationsByDate(new DateTime(2015, 9, 8));
            });


            foreach (var item in res)
            {
                int roomNum = Int32.Parse(item.Room.Number);
                int timeRes = ((DateTime)item.EndTime).Hour;
                resArr[roomNum - 300, timeRes] = item;
            }
            return View(resArr);
        }