When I am using
var frontPage = await GetFrontPage();
protected override async Task<WordDocument> GetFrontPage()
{
return null;
}
This code works fine and I am getting null value in frontpage variable. but when I am rewriting the function as
protected override Task<WordDocument> GetFrontPage() => null;
I am getting an NullReferenceException
.
Could anyone help me to understand the difference between the two statements.?