Converting from an int to a bool in C# -


int vote;  insertvotes(objecttype, objectid , vote, userid); //calling 

for method call, want convert vote bool. how can convert it?

here method signature:

 public static bool insertvotes(int forumobjecttype,                                  int objectid,                                 bool isthumbup,                                  int userid)  {     // code... } 

you can try like

insertvotes(objecttype, objectid , (vote == 1), userid); //calling 

assuming 1 voted up, , 0 voted down, or that.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -