c# - Whats the best practice for returning a Boolean and string value -


i've created method performs validations against xml hierarchy dynamically generated class in javascript text during run time.

my method returns either true or false, helpful using class i'd return more informative information since there may several reasons can throw false message.

at first thought change return type bool generic collection type having string key , boolean value don't know if best approach.

what best practice in case?

make class

public class validationresponse {     public bool successful { get; set; }     public string information { get; set; } } 

and return object of validationresponse


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -