Cannot create an instance of the abstract class or interface interface with type
===

I know what this error is, my question is slightly different.

This is one of these brain fade moments.

I've been reading this interesting article on Repositoy and Unit of Work patterns:

http://www.asp.net/mvc/tutorials/getting-started-with-ef-using-mvc/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application

I am having a play with this code and I'm now trying to tweak it so I can use IoC with DI.

Now, here is where I have just hit a mental blank.

I am changing all my classes to use interfaces etc. So given this code snippet:

        public class UnitOfWork : IDisposable
        {
            private SchoolContext context = new SchoolContext();
            private GenericRepository<Department> departmentRepository;
            private GenericRepository<Course> courseRepository;
    
            public GenericRepository<Department> DepartmentRepository
            {
                get
                {
    
                    if (this.departmentRepository == null)
                    {
                        this.departmentRepository = new GenericRepository<Department>(context);
                    }
                    return departmentRepository;
                }
            }
        }
    }

How do I edit this line:

    this.departmentRepository = new GenericRepository<Department>(context);

So I don't have to reference the actual class so I can ensure it is decoupled and avoid producing the syntax error:

    Cannot create an instance of the abstract class or interface interface with type

Many thanks in advance!
