1

I have a controller like this :

public ActionResult MainController()

/*do stuff*/

JsonResult jsonresult;
return jsonresult;

I'm trying to make this Async like this :

public async Task MainController()

/*do stuff*/   

JsonResult jsonresult;
return /*I don't know what to write*/

I have searched SO and some other sites but I couldn't find a solution. As I saw, FromResult is used but when I used it, I got errors. Any help is appreciated. Thanks.

1 Answer 1

1

Change the action method to look like this and you can return your inital result again:

public async Task<ActionResult> MainController()

btw: the name of the action is a bit strange... ;)

Sign up to request clarification or add additional context in comments.

1 Comment

It looks like the constructor for the Main controller now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.