main
1using System;
2using Castle.MicroKernel.Registration;
3
4namespace gorilla.commons.infrastructure.thirdparty.castle.windsor
5{
6 public static class WindsorExtensions
7 {
8 public static BasedOnDescriptor LastInterface(this ServiceDescriptor descriptor)
9 {
10 return descriptor.Select((type, base_type) =>
11 {
12 Type first = null;
13 var interfaces = type.GetInterfaces();
14 if (interfaces.Length > 0) first = interfaces[0];
15
16 return (first != null) ? new[] {first} : null;
17 });
18 }
19 }
20}