Subsonic 3.Save () VS.Update () and .Add ()

What is the difference between: .save ();
.Add (); .update ():

+3
source share
1 answer

You do not specify which templates you use (I'm going to use ActiveRecord), but as a rule:

  • Save will be inserted if the object IsNew==trueor otherwise it will be an update.
  • Add will always insert a new record.
  • The update will only update the object with IsNew==falseand will not work if there is no corresponding entry in db for the instance.
+10
source

Source: https://habr.com/ru/post/1712593/


All Articles