Click or drag to resize

How To Query for a Named Asynchronous Type Registration

This topic details the steps necessary for checking whether a type is registered with a specific name for asynchronous resolution with a Unity container.

  1. Import the Unity Container Async Extensions namespace:

    C#
    using Ditto.AsyncInit.Unity;
  2. Query the container for named registration:

    C#
    if (container.IsAsyncTypeRegistered<IUniversalAnswerService>("Deep Thought"))
    {
        //...
    }
See Also