2016-11-20 6 views
-1
public static List<Reservations> getReservations(int reservationId) 
{ 
    return hoteldb.hotel_reservations.Where(x => x.reservation_id == reservationId).ToList(); 
} 

私は値を変換しましたが、私はすべてが良いですが役に立たないことを確認しました。LINQ一般的なリストは問題を変換できません

それは本当に以下でもコード働いていない:List<hotel_reservations>:getReservationsたぶん

public List<Reservations> getReservations(int reservationId) 
{ 
    return hoteldb.hotel_reservations.Where(x => x.reservation_room_desc == "sdfsfs").ToList(); 
} 
+0

どのタイプが 'hotel_reservations'で、どのタイプが' reservation_id'(私は 'int'と仮定しますか)ですか? –

+0

エラーメッセージがありますか? – Yanga

+0

あなたは予約クラスを投稿することもできますか? – Miguel

答えて

0

は()のタイプを使用する必要がありますか?

public List<hotel_reservations> getReservations(int reservationId) 
    { 
     var y = hoteldb.hotel_reservations 
       .Where(x => x.reservation_room_desc == "sdfsfs") 
       .ToList(); 
     return y; 
    } 
関連する問題