Implementing the Repository and Unit of Work Patterns