Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library

Comment by malakai521

3 months ago

`var post = await _postService.getById(id);`

the F# equivalent is

`let! post = _postService.getById id`

3 comments

malakai521

Reply

alternatex  3 months ago

You're missing the task {} block

  • neonsunset  3 months ago

    This assumes the context is already a task computation expression, which is what you'd have in asynchronous code.

  • sWW26  3 months ago

    and the C# is missing the `async Task` boilerplate

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities