/// <summary> /// Returns AOP-enabled service interface previously registered using SvcLocator.Register(). /// </summary> /// <typeparam name="TInterface">An interface type.</typeparam> /// <param name="aspects"></param> /// <returns>AOP proxy representing service interface.</returns> public static InstanceProxy <TInterface> GetService <TInterface>(IEnumerable <Aspect> aspects = null) where TInterface : class { InstanceProxy <TInterface> proxy = new InstanceProxy <TInterface>(SvcLocator.Get <TInterface>(), aspects); return(proxy); }
/// <summary> /// Returns AOP-enabled service interface previously registered using SvcLocator.Register(). /// </summary> /// <typeparam name="TDispInterface">An interface subclassing IDisposable.</typeparam> /// <param name="aspects"></param> /// <returns>AOP proxy representing service interface.</returns> public static RunDisposeProxy <TDispInterface> GetDispService <TDispInterface>(IEnumerable <Aspect> aspects = null) where TDispInterface : class, IDisposable { RunDisposeProxy <TDispInterface> proxy = new RunDisposeProxy <TDispInterface>(SvcLocator.Get <TDispInterface>(), aspects); return(proxy); }