I have this function with callback parameter Action<string> callback
:
public void sync(Action<string> callback)
{
var client = new RestClient(RestfulPaths.BASE_URL);
var request = new RestRequest(RestfulPaths.SYNC_CHECK, Method.GET);
var json = client.Execute(request);
client.ExecuteAsync(request, response =>
{
callback(response.Content);
});
}
I tried to call this function in another part of application:
ServerSync = manager.sync({
// Get data here
});