difference of using async/await and async methods

Viewed 36

What is the difference between these two code samples?

    public async Task<Product> GetProduct(string id)
    {
        return await _context
                       .Products
                       .Find(p => p.Id == id)
                       .FirstOrDefaultAsync();
    }

And

    public Task<Product> GetProduct(string id)
    {
        return _context.Products.Find(x => x.Id == id).FirstOrDefaultAsync();
    }

Does it make a difference?

0 Answers
Related