HasReturnValue
public bool HasReturnValue();
public bool HasReturnValue(out LitJson.JsonData jsonData, bool isFlatten);
Parameters
Value | Type | Description | Default |
---|---|---|---|
jsonData | jsonData | (Optional) If returnValue exists, it assigns returnValue in a JsonData format to the passed argument. | - |
isFlatten | bool | (Optional) Whether the data type that exists in returnValue is removed | false |
Description
Checks whether returnValue exists in the BackendReturnObject object returned as a result of the request made to the server.
returnValue only exists if the request was successful.
Example
var bro = Backend.BMember.GetUserInfo();
LitJson.JsonData jsonData = null;
if(bro.HasReturnValue()) {
jsonData = bro.GetReturnValuetoJSON();
}
if(bro.HasReturnValue(out jsonData)) {
// Post-process
});
}
Return casess
When the returnValue exists and isFlatten is false
return : true
jsonData : GetReturnValuetoJSON
When the returnValue exists and isFlatten is true
return : true
jsonData : GetFlattenJSON
When the returnValue does not exist
return : false
jsonData : null