增加项目,分层

This commit is contained in:
chfei committed 2026-09-11 19:11:12 +08:00
1 parent 6e995a5bdb
commit 0a3e5af6a9
234 files changed
+26994 -1

No files matched your search

@@ -0,0 +1,40 @@
using Autofac;
using Prism.Ioc;
namespace Prism.Autofac
{
/// <summary>
/// Extensions help get the underlying <see cref="IUnityContainer" />
/// </summary>
public static class PrismIocExtensions
{
/// <summary>
/// Gets the <see cref="IUnityContainer" /> from the <see cref="IContainerProvider" />
/// </summary>
/// <param name="containerProvider">The current <see cref="IContainerProvider" /></param>
/// <returns>The underlying <see cref="IUnityContainer" /></returns>
public static IContainer GetContainer(this IContainerProvider containerProvider)
{
return ((IContainerExtension<IContainer>)containerProvider).Instance;
}
/// <summary>
/// Gets the <see cref="IUnityContainer" /> from the <see cref="IContainerProvider" />
/// </summary>
/// <param name="containerRegistry">The current <see cref="IContainerRegistry" /></param>
/// <returns>The underlying <see cref="IUnityContainer" /></returns>
public static IContainer GetContainer(this IContainerRegistry containerRegistry)
{
return ((IContainerExtension<IContainer>)containerRegistry).Instance;
}
/// <summary>
/// Gets the <see cref="ContainerBuilder"/> used to register services.
/// </summary>
/// <param name="registry"></param>
/// <returns>The current <see cref="ContainerBuilder"/></returns>
public static ContainerBuilder GetBuilder(this IContainerRegistry registry)
{
return ((IAutofacContainerExtension)registry).Builder;
}
}
}