Click here to Skip to main content
15,914,642 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I Want to Stop a Controller with out returning any value for that I need to return like this

C#
public int BackgroundService(string lati, string longi)
        {
            BackGroundService objBGServices = new BackGroundService();
            return objBGServices.DispatcherTimerSetup(httpClient, lati, longi, UserId);
        }


but i am getting error like

Error:
Error 83 Cannot implicitly convert type 'void' to 'int'
Posted
Comments
BillWoodruff 6-Dec-13 7:13am    
Please read the QA Guidelines and do not post your question on more than one forum.

1 solution

If you can change the method signature the make it return void instead of int.
On the other hand, if you can't change the method signature then replace
Quote:
return objBGServices.DispatcherTimerSetup(httpClient, lati, longi, UserId);

with
C#
objBGServices.DispatcherTimerSetup(httpClient, lati, longi, UserId);
return 0; // or whatever int value that makes sense
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900