public IRegistration LookupType(Query targetType, ResolverContext context) { IRegistration registration = underlying.LookupType(targetType, context); if (registration != null) { return registration; } Type type = targetType.ServiceType; if (!type.IsInterface && !type.IsAbstract && targetType.Name == null) { lock (createdRegistrations) { if (createdRegistrations.ContainsKey(type)) return createdRegistrations[type]; var reg = new Registration { Service = targetType.ServiceType, Implementor = targetType.ServiceType, Lifestyle = lifestyle }; createdRegistrations.Add(type, reg); return reg; } } return null; }
private bool Equals(Registration other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return other.Guid.Equals(Guid); }