task parallel library - An alternative to TaskEx.FromResult on a platform where it's not available -


i converting portable class library use different profile (78). of changes related reflection api, , have few last lines don't compile, of them using taskex.fromresult.

taskex.fromresult handy when method returns task, , value of t needs wrapped , returned method, e.g.:

public task<int> returntaskofint() {     return taskex.fromresult(42); } 

unfortunately taskex not available pcl profiles. perhaps shouldn't hard write replacement it, , appreciate advise.

oops, damn easy. taskex.fromresult not available, task.fromresult there.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -