c# bool类型和int类型的互转

 项目过程当中,会有model的一些属性字段为‘是’或‘否’html 数据库字段一半定义为int,值则是0或1数据库 数据库model转实体类的时候,bool和int能够直接相互转换post false强转int 值就是0spa true 强转int 值就是1code   1 var a = true; 2 Console.WriteLine(Convert.ToInt32(a)); 3 var
相关文章
相关标签/搜索