我对如何实施符合以下条件的登记感到困惑:
我使用了以下方法,但我不明白在哪里放置' where‘类型是子句:
private BasedOnDescriptor CreateDescriptor<TInterface>(Predicate<Type> accepted)
{
return Classes
.FromAssemblyContaining<TInterface>()
.IncludeNonPublicTypes()
.Where(Component.IsInSameNamespaceAs<TInterface>())
.WithService.AllInterfaces()
.WithService.Self();
}“接受”子句应该指出应该使用什么类型的名称,谢谢。
发布于 2014-10-01 01:47:01
.If(t => t.Name.EndsWith("Adapter"))
但是,抛开这一问题,为了架构清晰起见,将类型分离到它们自己的命名空间中可能是个好主意。副作用是,您不需要额外的过滤器谓词。
https://stackoverflow.com/questions/26125808
复制相似问题