views:

77

answers:

3

So I'm going with nHibernate, but want to design my datalayer so I could potentially swap out (or switch) to a linqToSql layer.

How should I go about designing this?

Should I make an interface that has all my database calls?

Something like this?

GetUser();
InsertUser();
A: 

Yes use the repository pattern. Look it up.

Malcolm
+3  A: 

Good Example of the Repository Pattern

AgileJon
+1  A: 

Look at the usage of repository pattern in this article and you may get a good idea.

http://ayende.com/Blog/archive/2007/06/08/Rhino-Commons-RepositoryltTgt-and-Unit-Of-Work.aspx

CodeToGlory