EditableRootList Saving Object But Not Marking Them As Old

EditableRootList Saving Object But Not Marking Them As Old

Old forum URL: forums.lhotka.net/forums/t/11326.aspx


mattruma posted on Monday, April 23, 2012

I am trying to creating an EditableRootList object a BusinessListBase<EditableRootList, EditableChild> ... Everything seems to work ... but when I call Save, new objects are still marked as new ... I have the following code in my EditableRootList for handling the updates ...

        [Csla.Transactional(Csla.TransactionalTypes.TransactionScope)]
        protected override void DataPortal_Update()
        {
            this.Child_Update();
        }

When I run the following code ...

var apiTokenEditList = ApiTokenEditList.Fetch();
 
            apiTokenEditList.Add(DataHelper.RandomString(20));
            apiTokenEditList.Add(DataHelper.RandomString(20));
            apiTokenEditList.Add(DataHelper.RandomString(20));
 
            apiTokenEditList.Save();

 

I still have (3) new objects in apiTokenEditList ... even though the records were persisted to the database ... any idea why this is happening?

 

mattruma replied on Monday, April 23, 2012

Just me being silly ... will leave this up in case someone else runs into this issue ... but the fix was simply ...

 apiTokenEditList = apiTokenEditList.Save();

 

Copyright (c) Marimer LLC