I am working with checkboxes in MVC. I have a table with one column as bit type.The following code giving me an error.
[HttpPost]
public string Index(IEnumerable<City> cities)
{
if (cities.Count(x => x.Chosen) == 0)
{
return "You did not select any city";
}
......
}
Chosen is a bit type here. and when I am trying to build it says:
Cannot implicitly convert type 'bool?' to 'bool'. An explicit conversion exists (are you missing a cast?)
x.Chosentype ofbool??