Open generics

You can register an instance of an object by calling .Register() with the object reference as the only parameter. That automatically generates a singleton dependency.

public interface IMyService<T> {}
public class MyService<T> : IMyService<T> {}
ServiceLocator.Register(typeof(MyService<>));
IMyService svc1 = ServiceLocator.Get<IMyService<int>>();
// svc1 = instance of MyService<int>

IMyService svc2 = ServiceLocator.Get<IMyService<string>>();
// svc2 = instance of MyService<string>