プロジェクトをビルドすると、このコードが失敗します。声明がParkingLotが真であるかどうかをチェックしなければならない場合。 trueの場合に文が失敗する
<th class="small-12 large-6 columns last">
<table>
<tr>
<th width="300">
<p class="text-left small-text-left">
@if(Model.Point.Store.JsonDynamic.En.Motel.ParkingLot == True)
{
<span>Possibility for parking</span><br>
}
</p>
</th>
<th class="expander"></th>
</tr>
</table>
</th>
しかし、私はこのエラーを取得する:私はそれを行うための方法は、次のコードだと思った
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot implicitly convert type ''Newtonsoft.Json.Linq.JValue'' to ''bool''. An explicit conversion exists (are you missing a cast?)
は、誰もが、私はここで間違ってやっているかを見ることができますか?
を試してみてください。 @if((ブール)Model.Point.Store.JsonDynamic.En.Motel.ParkingLot == True){...} – Aaron