So i have started on a uber for 'x' app. Same concept as Uber. And the following code is the code on my Signalr hub. I use signalr to communicate between client and server. So when a client request for help it connects to RequestForHelp. Then the RequestForHelp sends back a request to the right supplier. And depending on what the supplier answers either HelpResponseYes HelpResponseNo is called. I want to make this a async. I want to make the requestforhelp a task. So when i click the request button the program awaits. Any suggestions how you can do that?
public void RequestForHelp(RequestDetails requestDetails, Location customerClientLocation, int customerClientId)
{
Customer Customer = Service.CustomerService.GetCustomerById(requestDetails.CustomerId);
Customer.ClientId = customerClientId;
Customer.ClientLocation = customerClientLocation;
requestDetails.Customer = Customer;
Clients.User(requestDetails.NearestSupplierList.FirstOrDefault().AspNetUserID).requestForHelpInClient(requestDetails);
}
public void HelpResponseYes(RequestDetails requestDetails)
{
//A supplier is matched
}
public void HelpResponseNo(RequestDetails requestDetails)
{
//next supplier on the list
}