The issue that you are seeing is because you are trying to instantiate a new ContactRepository()
.
The appropriate way to reference the repository is by creating the object through Sitecore's Configuration systemFactory.
private ContactRepository _repository = Sitecore.Configuration.Factory.CreateObject("tracking/contactRepository", true) as ContactRepository;