---
title: "Discussion on \"Returning null from Task-returning methods in C#\" | Hashnode"
description: "Discussion on \"Returning null from Task-returning methods in C#\". Introduction\nTake a look at the following code and guess what happens when the Main method gets invoked:\npublic class Program\n{\n    public static async Task Main()\n    {\n        var result = await AsyncFoo();\n        result = await NonAsyncFoo();\n   ..."
url: "https://hashnode.com/posts/returning-null-from-task-returning-methods-in-c-sharp/61e074804a9e96783d23781a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Returning null from Task-returning methods in C#](https://zachsnoek.hashnode.dev/returning-null-from-task-returning-methods-in-c-sharp?utm_source=hashnode&utm_medium=feed)

Introduction Take a look at the following code and guess what happens when the Main method gets invoked: public class Program { public static async Task Main() { var result = await AsyncFoo(); result = await NonAsyncFoo(); ...

Jan 13, 2022 · 5 min read · zachsnoek.hashnode.dev  
Read the article

-   [#csharp](https://hashnode.com/tag/csharp)
-   [#net](https://hashnode.com/tag/net)

## Written by

[Zach Snoek](https://hashnode.com/@zachsnoek)

@zachsnoek · Washington, USA

  
[View profile](https://hashnode.com/@zachsnoek)

Software Engineer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
