/// <summary>
 ///     Create the type.
 /// </summary>
 /// <param name="requestedType">Type user requested to be resolved.</param>
 /// <param name="container">Container that requested the creation.</param>
 /// <param name="parameters">Any user parameters passed.</param>
 /// <param name="options">The options.</param>
 /// <returns> Instance of type. </returns>
 public abstract object GetObject(Type requestedType, DependencyContainer container, Dictionary <string, object> parameters, DependencyContainerResolveOptions options);
 public override object GetObject(Type requestedType, DependencyContainer container, Dictionary <string, object> parameters, DependencyContainerResolveOptions options)
 {
     try
     {
         return(container.ConstructType(_registerImplementation, Constructor, parameters, options));
     }
     catch (DependencyContainerResolutionException ex)
     {
         throw new DependencyContainerResolutionException(_registerType, ex);
     }
 }
            public override object GetObject(Type requestedType, DependencyContainer container, Dictionary <string, object> parameters, DependencyContainerResolveOptions options)
            {
                if (parameters.Count != 0)
                {
                    throw new ArgumentException("Cannot specify parameters for singleton types");
                }

                lock (_singletonLock)
                {
                    if (_current == null)
                    {
                        _current = container.ConstructType(_registerImplementation, Constructor, null, options);
                    }
                }

                return(_current);
            }
            public override object GetObject(Type requestedType, DependencyContainer container, Dictionary <string, object> parameters, DependencyContainerResolveOptions options)
            {
                var instance = _instance.Target;

                if (instance == null)
                {
                    throw new DependencyContainerWeakReferenceException(_registerType);
                }

                return(instance);
            }
 public override object GetObject(Type requestedType, DependencyContainer container, Dictionary <string, object> parameters, DependencyContainerResolveOptions options)
 {
     return(_instance);
 }
            public override object GetObject(Type requestedType, DependencyContainer container, Dictionary <string, object> parameters, DependencyContainerResolveOptions options)
            {
                if (!(_factory.Target is Func <DependencyContainer, Dictionary <string, object>, object> factory))
                {
                    throw new DependencyContainerWeakReferenceException(_registerType);
                }

                try
                {
                    return(factory.Invoke(container, parameters));
                }
                catch (Exception ex)
                {
                    throw new DependencyContainerResolutionException(_registerType, ex);
                }
            }
 public override object GetObject(Type requestedType, DependencyContainer container, Dictionary <string, object> parameters, DependencyContainerResolveOptions options)
 {
     try
     {
         return(_factory.Invoke(container, parameters));
     }
     catch (Exception ex)
     {
         throw new DependencyContainerResolutionException(_registerType, ex);
     }
 }