更新框架
This commit is contained in:
1 parent
ef50fa0620
commit
84b28f9672
72 files changed
+2222
-282
No files matched your search
+17
-5
@@ -150,12 +150,18 @@ public class AutofacContainerExtension : IContainerExtension<IContainer>, IConta
|
||||
|
||||
public IContainerRegistry RegisterSingleton(Type type, Func<object> factoryMethod)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
ArgumentNullException.ThrowIfNull(type);
|
||||
ArgumentNullException.ThrowIfNull(factoryMethod);
|
||||
Builder.Register(_ => factoryMethod()).As(type).SingleInstance();
|
||||
return this;
|
||||
}
|
||||
|
||||
public IContainerRegistry RegisterSingleton(Type type, Func<IContainerProvider, object> factoryMethod)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
ArgumentNullException.ThrowIfNull(type);
|
||||
ArgumentNullException.ThrowIfNull(factoryMethod);
|
||||
Builder.Register(_ => factoryMethod(this)).As(type).SingleInstance();
|
||||
return this;
|
||||
}
|
||||
|
||||
public object Resolve(Type type)
|
||||
@@ -192,12 +198,18 @@ public class AutofacContainerExtension : IContainerExtension<IContainer>, IConta
|
||||
|
||||
public IContainerRegistry Register(Type type, Func<object> factoryMethod)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
ArgumentNullException.ThrowIfNull(type);
|
||||
ArgumentNullException.ThrowIfNull(factoryMethod);
|
||||
Builder.Register(_ => factoryMethod()).As(type);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IContainerRegistry Register(Type type, Func<IContainerProvider, object> factoryMethod)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
ArgumentNullException.ThrowIfNull(type);
|
||||
ArgumentNullException.ThrowIfNull(factoryMethod);
|
||||
Builder.Register(_ => factoryMethod(this)).As(type);
|
||||
return this;
|
||||
}
|
||||
public IContainerRegistry RegisterMany(Type type, params Type[] serviceTypes)
|
||||
{
|
||||
@@ -320,4 +332,4 @@ public class AutofacContainerExtension : IContainerExtension<IContainer>, IConta
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user