Maybe our experience will help. Rather than SqlRepository as a static class, we use AutoFac for injection and hide the container behind a static class. Then each entity has a static repository property:
public class Part : inheritence...
{
public static IPartRepository Repository
{
get { return IoCContainer.GetInstance<IRepository<Part>>(); }
}
// ... more part-y stuff
}
This way we can swap out the implementation and callers always know where to get it:
Part p = Part.Repository.Get(id);
In another project there is a PartRepository registered with the container:
public class PartRepository : IPartRepository
{
// IPartRepository implementation that talks to injected DAL
}
In yet another project we have mocks for testing, including repositories pre-loaded with known entires:
public class MockPartRepository : Dictionary<Part, int>, IPartRepository
{
// IPartRepository implementation based on dictionary
}
...and it is registered with the container for unit testing. The SAME call gets the repository:
Part p = Part.Repository.Get(id);