Firstly we converted return byte code to string and now want to true or false on behalf oh returning string content .But it giving an error string was not recognized as a valid boolean. here we declare bool Result=false and after that -

and byte code coming in OutData. and after that this code as following-
C#
_EmailRequest.requestDataId = js.Serialize(objDic);
???????_EmailRequest.AppHostUrl = _AppConfigManager.AppHostUrl;
_EmailRequest.moduleId = ModuleOption.Invoice;
OutData = GetMail(_EmailRequest, out Result);
string content = Encoding.UTF8.GetString(OutData, 0,OutData.Length);
Result = Convert.ToBoolean(content);

Mohammad HussainRank #513 · 4.8K reputationPosted Aug 28, 2023, 3:13 AM EDT
_EmailRequest.requestDataId = js.Serialize(objDic); _EmailRequest.AppHostUrl = _AppConfigManager.AppHostUrl; _EmailRequest.moduleId = ModuleOption.Invoice; OutData = GetMail(_EmailRequest, out Result); string content = Encoding.UTF8.GetString(OutData, 0, OutData.Length); // Check if the content is "true" or "false" and set the Result boolean accordingly if (content.Trim().Equals("true", StringComparison.OrdinalIgnoreCase)) { Result = true; } else if (content.Trim().Equals("false", StringComparison.OrdinalIgnoreCase)) { Result = false; } else { // Handle the case where the content is neither "true" nor "false" // You might want to set a default value for Result or handle the error condition. }