Repository pattern - Switch out the database and switch in XML files
- by glasto red
Repository pattern - Switch out the database and switch in XML files.
Hello
I have an asp.net MVC 2.0 project and I have followed the Repository pattern.
Periodically, I am losing access to the database server so I want to have another mechanism in place (XML files) to continue developing. It is not possible to have a local version of the db unfortunately!
I thought this would be relatively easy using the Repository pattern, to switch out the db repositories and switch in XML versions.
However, I am having real trouble coming up with a solution.
I have tried LinqToXML but then ran into problems trying to return a List of News items as the LinqToXML ToList returns Generic.List
Should I be mapping the XElement list over to the News list by hand?
It just seems a bit clunky compared to LinqToSQL attributes on the News class and then simply doing a Table.....ToList();
Any direction would be appreciated.
Thanks