Has anybody ever encountered that BeginSave() not call DataPortal_Insert()?
Please help me,Thanks!
BeginSave may call:
If <bo>.IsDeleted call DataPortal_DeleteSelf
else If <bo>.IsNew call DataPortal_Insert
else call DataPortal_Update
So - which method is called depends on the state of your object.
I 'm sure that my Ojbect.IsNew is true, Why the DataPortal_Insert not be called?
Is the objects IsDirty and IsSavable both true?
Both IsDirty and IsSavable are true.
Add Csla projects to your solution and debug into the csla code:
In the BusinessBase.Save method (If IsDirty is false then object is returned) :
result = (T)DataPortal.Update(this);
result = (T)this;
Save might throw an exception (If this is just "swallowed")
throw new InvalidOperationException(Resources.NoSaveChildException);
if (EditLevel > 0)
throw new InvalidOperationException(Resources.NoSaveEditingException);
if (!IsValid && !IsDeleted)
throw new Rules.ValidationException(Resources.NoSaveInvalidException);
throw new InvalidOperationException(Resources.BusyObjectsMayNotBeSaved);
(Save may also throw DataPortalException if serverside code fails).
Serverside code follows the outline in my first post.
Copyright (c) Marimer LLC