外部データベーステーブルからチェックボックスのリストをレンダリングしようとしていますが、このエラーが発生し続けます: タイプ 'int' を 'bool' に暗黙的に変換できません。
リストを返す強く型付けされたビューの幸せな b/c ではないと推測しています。誰でも助けてください。前もって感謝します。
私のモデル
public partial class tblCity
{
public int ID { get; set; }
public string Name { get; set; }
public int IsSelected { get; set; }
}
私の見解
@model List<Demo.Models.Sample>
@for (int i = 0; i < Model.Count; i++)
{
@Html.CheckBoxFor(m => m[i].ID) **Cannot implicitly convert type 'int' to 'bool'**
}