Difference of DataPortal_Create() and DataPortal_Insert()

Difference of DataPortal_Create() and DataPortal_Insert()

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


jerbersoft posted on Tuesday, May 26, 2009

can someone please explain the difference of both methods or events? thanks!

Marjon1 replied on Tuesday, May 26, 2009

The differences between these two methods are really well explained in Rocky's books, which are an excellent spot to start getting a good understanding of CSLA.

However, it basically boils down to this:

- DataPortal_Create is used to setup/populate new objects with data that could come from the database, it is used to retrieve values not to populate them. This can be configured to run locally if not database access is required, and may not even be needed if you just want to use standard constructors as part of your factory methods.

- DataPortal_Insert is used to store the object if it is new and the Save() method is called, this generally involves putting the a new record into the database / storage mechanism that you use.

Copyright (c) Marimer LLC