Possible Duplicate:
Should I use Linq To SQL directly in code behind or use some other approach?
I already asked a question previously Separation Of Linq Queries from code behind.
Maybe I could not get an answer I am looking for.So I am asking it once again.I use my linq
to Sql
queries in code behind
directly.
I use functions though.
My question is how should I seperate them from code behind
?
What is a better approach. Should I use simple classes
and perform my database
operations(querying,insert,update,delete)
there and then just call those functions from code behind.
Is it the approach that I should follow. If yes then should I go for a single class or should I create one class per page.
Can anyone just guide me how should I organize this.What are the approaches that you guys follow?
I am using ASP.NET Web Forms/C#
.
A simple example will be a huge help.
Any suggestions are welcome.