private object GetServiceForGeneric(Type discriminator) { Type genericTypeDefinition = discriminator.GetGenericTypeDefinition(); if (TypesDictionary.TryGetValue(genericTypeDefinition.ToString(), out Type type)) { return(CreateInstance(type.MakeGenericType(discriminator.GetGenericArguments()[0]))); } return(null); }
public bool Remove(KeyValuePair <string, Type> item) { return(TypesDictionary.Remove(item)); }
public void CopyTo(KeyValuePair <string, Type>[] array, int arrayIndex) { TypesDictionary.CopyTo(array, arrayIndex); }