Returning Enum in async Task<Enum> and getting value : <p>I was looking to return an enum depending on the outcome of my asynchronous method.</p>

<pre><code>public enum ReponseType
{
    Success,
    Error
}
</code></pre>

<p>Here is the method that returns the response type:</p>

<pre><code>    public async Task&lt;ReponseType&gt; MethodThatDoesStuff()
    {
        await Task.Run(() =&gt;
        {
            //Doing stuff here

            return ResponseType.Success;

        });
        return ReponseType.Error;
    }
</code></pre>

<p>when I call this method I can't get access to what the value is:</p>

<pre><code>var resp = await _writer.MethodThatDoesStuff();
</code></pre>

<p>Even if I use:</p>

<pre><code>ResponseType resp = await _writer.MethodThatDoesStuff();
</code></pre>

<p>I still can't get the enum value.</p>

<p>resp.[intellisense] only give me GetType(), GetTypeCode(), CompareTo() etc...</p>

<p>Is it not ok/efficient to return an enum like this if I only want to know if its a success or error?</p>

<p>What would be the best way to do this?</p>

<p>Thanks</p>
