Linq to SQL Model

Jul 21, 2010 at 7:03 PM

Sacha,

I've been thru the sample app for WPF and the articles, but I'm still having trouble figuring out how to use Linq to SQl in a model. Is there a sample some where that I can have a look at?

 

-THumphr

Coordinator
Jul 23, 2010 at 11:37 AM

The demo app for Cinch v1 shows you how, the only thing I would do is move all the DataWrappers into the ViewModel as well as the rules, and IEditableObject stuff and make the ViewModel properties just write directly to the Model, and also make the ViewModel inherit from EditableValidatingViewModel, rest should be the same.

 

I basically changed my mind, see for CInch what I thought was that you would have something like this

 

Database -> Soap Service (or whatever) -> Linq to SQL (say) -> serialise -> Cinch Model -> Cinch ViewModel -> View

 

But loads of people just wanted to do 

 

Database -> Soap Service (or whatever) -> Linq to SQL (say) -> serialise -> Cinch ViewModel -> View

 

So its nearly the same as Cinch V1 demo app its just model is dumb, and ViewModel will hold rules / validation / DataWrappers / IEditableObject 
etc etc