public static BasedOnDescriptor FirstNonGenericCoreInterface(this ServiceDescriptor descriptor, string interfaceNamespace) { var allInterface = descriptor.AllInterfaces(); var filtered = allInterface.If(type => { var interfaces = type.GetInterfaces() .Where(t => t.IsGenericType == false && t.Namespace.StartsWith(interfaceNamespace)); if (interfaces.Count() > 0) { return(true); } return(false); }); return(filtered); }