Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Async controller methods #20

Closed
khorvat opened this issue Sep 18, 2013 · 10 comments
Closed

Support for Async controller methods #20

khorvat opened this issue Sep 18, 2013 · 10 comments

Comments

@khorvat
Copy link

khorvat commented Sep 18, 2013

Hi,

do you plan to add support for async controllers ?

btw great library.

Thanks

@ploeh
Copy link
Owner

ploeh commented Sep 18, 2013

'Plan' is such a big word, but I've considered it :)

I think it's a good idea.

@khorvat
Copy link
Author

khorvat commented Sep 18, 2013

Just to be clear, if I pass in the async method without awaiting or invoking result your code works, but VS is raising warnings all over the place.

So if there is a room in your 'plan' it would be nice to kill those warnings.

Thanks

On Sep 18, 2013, Mark Seemann notifications@github.com wrote:

'Plan' is such a big word, but I've considered it :)

I think it's a good idea.


Reply to this email directly or view it on GitHub:
#20 (comment)

-- Sent from my Android phone with K-@ Mail. Please excuse my brevity.

@ploeh
Copy link
Owner

ploeh commented Oct 15, 2013

The problem with adding support for this right now is that in order to do that, I'd have to upgrade Hyprlinkr to target .NET 4.5, and right now it only supports .NET 4.0.

However, the up-coming Web API 2 (version 5.0.0 AFAICT) seems to support only .NET 4.5, so it seems reasonable to upgrade Hyprlinkr at that time too. After that, I'll add support for async controllers.

@ploeh
Copy link
Owner

ploeh commented Oct 17, 2013

I found a way to implement this on .NET 4.0, so the latest version of Hyprlinkr (0.9.9) now supports async Controller methods like this:

Uri actual = linker.GetUriAsync((AsyncController c) => c.Get(id)).Result;

@ploeh ploeh closed this as completed Oct 17, 2013
@khorvat
Copy link
Author

khorvat commented Oct 18, 2013

Great, I'll give it a try and let you know how it goes.

Thanks

@khorvat
Copy link
Author

khorvat commented Oct 23, 2013

Just to confirm that everything is working as expected - without warnings ;) ... thanks again.

@ploeh
Copy link
Owner

ploeh commented Oct 23, 2013

Thank you for reporting back :)

@barbosatek
Copy link

AsyncController is MVC specific, do you have any workaround for WebAPI?

@khorvat
Copy link
Author

khorvat commented Dec 16, 2016

Hi @barbosatek, the above example is working in WebAPI so could you give us an example if the issue you have ?

@ploeh
Copy link
Owner

ploeh commented Dec 16, 2016

AsyncController is MVC specific, do you have any workaround for WebAPI?

Discussion moved to #42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants