Adding order actions like "Print" or "RePrint"
There aren't too many ifs in this code. However, what you can reduce is indentation and it will help readability.

This code:

public async Task AddOrderActionAsync(...)
{
    if (!string.IsNullOrWhiteSpace(value))
    {
        // Everything here
    }
}


Can be rewritten as:

public async Task AddOrderActionAsync(...)
{
    if (string.IsNullOrWhiteSpace(value))
        return;

    // Everything here
}


With the nice side-effect to also remove negation.



Looking into the code you check orderAction != null, it seems you try to be defensive here but it's misleading because it can't be null. Ever. Also orderAction.Count() &gt; 0 is equivalent to orderCount.Any() which is shorter, faster and communicates better the intent. Content of the else clause is repeated then one of them should be dropped:

if (orderAction.Any())
    _context.tbl_OrderActions.RemoveRange(orderAction);

await AddOrderActionAsync(_context, identity, value, order_number);


In your query you're using .ToList() but it's unnecessary and without it EF (or ORM you're using) might be able to optimize database calls (if not then you at least gain in clarity).



It's not a rule but an accepted convention in C# to do not use underscore to separate words, a variable named order_number should be orderNumber.



You're catching a specific exception, nice! However I think it can be thrown only by AddOrderActionAsync() then it should be the only part inside try/catch:

try
{
    await AddOrderActionAsync(_context, identity, value, order_number);
}
catch (AddOrderActionException ex)
{
    // ...
}




Really don't ignore t3chb0t's suggestion about dependency injection, sending e-mails like that it's definitely not something you want to happen inside your unit testing...