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

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

php - Updating recent updates - Problem in procedure - Any other approach? -