public T Create <T>() where T : IService { if (_mapper.ContainsKey(typeof(T))) { Type target = _mapper[typeof(T)]; return((T)Activator.CreateInstance(target)); } else { return(default(T)); } }
public static T CreateInstance <T>() { if (_dictionary.ContainsKey(typeof(T))) { Type target = _dictionary[typeof(T)]; return((T)Activator.CreateInstance(target)); } else { return(default(T)); } }