views:

93

answers:

2

What is the difference between IRepository.Add and IRepository.Update in SubSonic3 SimpleRepository?

+2  A: 

Add should perform a sql Insert whereas Update should perform a sql Update. So Add is for new objects i.e. without a primary key value assigned.

Adam
Okay, yes, it seems that Add will just ignore the value of the primary key field in the object that is passed to it.
dangph
And Update silently ignores any object that is passed to it if that object isn't already in the table (based on its primary key). (I am testing with Sqlite3 BTW.)
dangph
A: 

Add returns objects, where as Update is an integer.

No Body