How can I implement the generic repository pattern and improve the performance for the code below?
The only way DI (IoC) is going to improve this code is by extracting the creation and disposal of your data context. This also means you can mock it for your unit tests.

You could argue the DataContext already is a Repository.

You could do one of:


Leave it as it is. No reason to complicate it just for the sake of it. It's small, pretty easy to follow and easily found.
Extract a Query object (Query Pattern)
Wrap the query and creation of the OfficeDTO in an OfficeDTO factor