[Solved] For each loop with submitting form
[ad_1] The error message is self explanatory. You have this in your view @model hotel.Models.RoomModel but you pass an instance of System.Data.Entity.Infrastructure.DbQuery<Hotel.BusinessObject.Room> to your view because of this line of code in your controller return View(roomService.GetRoomsByCategory(CategoryId, SelectedDate, NumberNights, NumberPeoples)); You need to pass an instance of RoomModel instead of System.Data.Entity.Infrastructure.DbQuery<Hotel.BusinessObject.Room>. I would suggest changing your … Read more