Question: I've searched but didn't find something that would clear my thoughts on this question..
Is this piece of code a bad practice? Or is it okay to have two await calls such as this?
I'm not sure if this 2 awaits could somehow run into some kind of issue..

```
var numero = await _context.xpto
            .AnyAsync(s => s.field1 == value1) ? await _context.xpto
            .Where(a => a.field1 == value1)
            .MaxAsync(a => a.field2) : 0;

```

Answer: 
There's nothing inherently wrong with two `await` keywords in the same statement.

However, this code could probably be simplified by using [`DefaultIfEmpty()`](https://msdn.microsoft.com/en-us/library/bb360179.aspx) as follows:

```
var numero = await _context.xpto
    .Where(a => a.field1 == value1)
    .Select(a => a.field2)
    .DefaultIfEmpty(0)
    .MaxAsync();

```

Instead of using the ternary operator to handle the case where the query is empty, `DefaultIfEmpty()` catches this case and returns a single default-valued element. This is probably also easier to read and more expressive of the intent. And it requires only a single pass through the sequence (your version makes two passes).

But back to your question, as long as you're conscious of order of evaluation and possible side effects including async exceptions, there's nothing wrong with multiple `await`s.
Rewrite the code without the conditional operator:

```
var any = await 
    _context.xpto.Any( //...);

int numero;

if (any)
{
    numero = 
       await _context.xpto
                     .Where(//...)
                     .MaxAsync(//...);
}
else
{
     numero = 0;
}

```

Does that look wrong somehow? To me it doesn’t, you are just making an awaitable task a continuation of another awaitable task.