Now that the interface is generic, we can start to work on the SpeakerRepository. First let's rename it to InMemorySpeakerRepository. Now, we want to start using generics. Create a new class, InMemoryRepository<T> and have the speaker repository inherit from it:
public abstract class InMemoryRepository<T> : IRepository<T>{ public abstract T Create(T speaker); public abstract T Get(int id); public abstract IQueryable<T> GetAll(); public abstract T Update(T speaker); public abstract void Delete(T speaker);}
In order to move slow and have the tests passing as much as possible, we are using abstract and will have to have each method in the speaker repository override the base class methods. This gives us ...