I also recommend linq it has made life much easier for me. I tend to take the same approach with linq be it a web application or windows form application. The first step that I take is that I always create a Repository class to handle most of my heavy lifting. Within the repository class, bare minimum I define the method that retorns all objects, the method to return one object, the method to create a new object, the method to delete an object and the method to save objects. I started doing this after reading Scott Guthrie's nerddinner snipper, an example is below.
Main Topics
Browse All Topics





by: naspinskiPosted on 2009-06-18 at 06:07:08ID: 24656969
Linq will make your life *much* easier, I can't recommend it enough.
1) the way I do it is to check if the Primary Key (I use integers) is 0, if it is, it is new.
2) linq automatically takes care of the changes - as for knowing what changed, I am not sure, but I think it can be done in Linq-to-Entities...?
3) That's it, it's simple!