public void AddIfRequired(IEntityConfig config)
 {
     if (!Current.ContainsDispatch(config))
     {
         config.Accept(new AddVisitor(), this);
     }
 }
 public static bool ContainsDispatch(this IState state, IEntityConfig config)
 => config.Accept(new ContainsDispatchVisitor(), state);
 public static bool IsCurrentPresentAndCompatibleDispatch(this IState state, IEntityConfig config)
 => config.Accept(new IsCurrentPresentAndCompatibleDispatchVisitor(), state);
 /// <summary>
 /// Get a model of the given entity model from the given state.
 /// </summary>
 /// <typeparam name="TModel"></typeparam>
 /// <param name="state"></param>
 /// <param name="config"></param>
 /// <returns></returns>
 public static TModel GetDispatch <TModel>(
     this IState state, IEntityConfig <TModel> config)
     where TModel : class
 => config.Accept(new GetVisitor <TModel>(), state);