redesign IRepository by http://martinfowler.com/eaaCatalog/repository.html
fix lock error on build