Registering objects

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 {}
public class MyService : IMyService {}
Registering an object as a service:
var repo = new ServiceRepository();

var myService = new MyService();

repo.Register(myService);
Resolving the service
var provider = repo.CreateServiceProvider();

IMyService svc1 = provider.Get<IMyService>();
// svc1 = references same object as myService

IMyService svc2 = provider.Get<IMyService>();
// svc1 = references same object as myService

MyService svc3 = provider.Get<MyService>();
// svc3 = references same object as myService

MyService svc4 = provider.Get<MyService>();
// svc4 = references same object as myService

// svc1,svc2,svc3 and svc4 all reference the same object (myService)