Context and entity types can be generated.
Repository can often be generated with T4 from an edmx.
And why not a real client context?
This project does all of this with a Unit test project to show how to use it.
Note that there are two solutions to download.