Mvc dbSet<Reserve> does not contain a definition for getAll()

Asked

Viewed 120 times

0

I created this method, however I get the error described above, someone knows a possible solution?

public IEnumerable<Reserva> GetBookingsByRoomId(int Id)
{
    HotelEntities db = new HotelEntities();
    var allBookings = db.Reserva.GetAll().ToList();
    var bookings = (from Quarto
                    in db.Quarto
                    where Quarto.ID_Quarto == Id
                    select Quarto
                   ).ToList();
    return Mapper.Map<List<Reserva>, List<Reserva>>(bookings);
}
  • but what mistake does it make?

  • var allBookings = db.Reserva.GetAll().ToList(); where I have getall()... it tells me that dbSet<Reserve> does not contain a definition for getAll()...

  • within this Hotelentities has the getall method?

  • If there is still need, I found now also: https://stackoverflow.com/a/32855426

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.