/// <summary> /// Registers a factory function which will be called to resolve the specified interface /// </summary> /// <typeparam name="T">Interface to register</typeparam> /// <param name="container">This container instance</param> /// <param name="factory">Factory method</param> /// <returns>IRegisteredType object</returns> public static ISvgRegisteredType Register <T>(this SvgContainer container, Func <T> factory) => container.Register(typeof(T), () => factory());
/// <summary> /// Registers a type /// </summary> /// <param name="container">This container instance</param> /// <typeparam name="T">Type to register</typeparam> /// <returns>IRegisteredType object</returns> public static ISvgRegisteredType Register <T>(this SvgContainer container) => container.Register(typeof(T), typeof(T));
/// <summary> /// Registers an implementation type for the specified interface /// </summary> /// <typeparam name="TInterface">Interface to register</typeparam> /// <typeparam name="TImplementation">Implementing type</typeparam> /// <param name="container">This container instance</param> /// <returns>IRegisteredType object</returns> public static ISvgRegisteredType Register <TInterface, TImplementation>(this SvgContainer container) => container.Register(typeof(TInterface), typeof(TImplementation));