Adding action id to a history repository
The problem is that the action id is static so it will be shared with all instances of the ActionIdContext class. That means that 2 separate pieces of work excuting at the same time could log everything with the same action id.

var client1 = new Client(someService);
var client2 = new Client(someService);
var client3 = new Client(someService);

Task.Run(() =&gt; client1.DoSomeGroupAction());
Task.Run(() =&gt; client2.DoSomeGroupAction());
Task.Run(() =&gt; client3.DoSomeGroupAction());


You have no idea how this code will log the actions - it could log them all with the same action id, it could log some with no action id and some with a common action id. It could also log some with one action id and others with another. 

The point I'm trying to make is, although a nice idea in theory, you can't locally instantiate state then share it via a static property and expect it to work.

Can't you add a LogHistories(Guid actionId, param History[] histories) method or something?



You should implement the full IDisposable.Dispose pattern;



public static Guid? ActionId
{
    get { return actionId; }
    set { actionId = value; }
}


would be better as an auto property.



HistoryBuilder is a bit weird - Builders are generally used with immutables or objects with very complex constructors (in my experience).