Insert Delete Noob question

Insert Delete Noob question

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


Digital-WebDev posted on Wednesday, July 11, 2007

I'm loving this CSLA it absolutely rocks but i have a question that is bothering me.

in my app i need to implement insert and delete functionality, the app uses both the binding source and local code objects (dim x as datalist)

My problem at the moment is how to effectively implement insert and delete. the documentation states that when i do .Save if .isdeleted or .isnew is not set then an update an occurs.

Exactly where does .isdeleted or .isnew get set ? do i need to create a property in my object and then set the properties before caling .save.

i need to implement this using both a form binding source and local code objects

 

hurcane replied on Wednesday, July 11, 2007

.IsNew is a read-only property. By default, CSLA.NET objects are new. If you use the DataPortal.Fetchmethod, it marks the object as old, so IsNew will be false.

.IsDeleted is also a read-only property, and is automatically handled when you use the delete techniques as described in the book.

Copyright (c) Marimer LLC