public IQueryable <Room> GetRooms(string city = null, int?pincode = 0, decimal?price = 0, Room.RoomCategory category = Room.RoomCategory.Cat0) { List <Room> roomList = new List <Room>(); IQueryable <Database.Room> rooms = _dbContext.Rooms.Where(r => (r.Price <= price || price == 0) && (r.Category == (byte)Enum.Parse(typeof(Room.RoomCategory), category.ToString()) || category == Room.RoomCategory.Cat0) && (r.Hotel.City == city || city == null) && (r.Hotel.PINCode == pincode || pincode == 0)); foreach (var item in rooms) { roomList.Add(_mapper.Map <Database.Room, Room>(item)); } return(roomList.AsQueryable()); }
public IQueryable <Room> GetRooms(string city = null, int?pincode = 0, decimal?price = 0, Room.RoomCategory category = Room.RoomCategory.Cat0) { return(_roomRepository.GetRooms(city, pincode, price, category)); }
public IHttpActionResult GetRooms(string city, int pincode, decimal price, Room.RoomCategory category) { _roomManager.GetRooms(city: city, pincode: pincode, price: price, category: category); return(Ok()); }