Newbie Question:Create Of New Object. DataPortal Fetch

Newbie Question:Create Of New Object. DataPortal Fetch

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


Maccurt posted on Saturday, March 03, 2007

using 2.1.0.0,I am looking at page #422 in  VB2005 Objects

If I am creating a NewProject I notice it says to do this in NewProject

   Return DataPortal.Create(of project)()

When I look in the DataAccess I see (page #425)...

   Overloads of DataPortal_Create(byval criteria as criteria)

I am confused because, I am never passing a criteria object. In my real example I simply want to create a new Project, at most I want to give the project an ID. Am I missing something simple?

 

 

JoeFallon1 replied on Sunday, March 04, 2007

The DataPortal methods are allowed to be Overrloaded.

So page 422 has no parameters. And page 425 has 1 parameter. You can create whatever set of parameters you need. But typically you would create various criteria objects. All of mine are in an external resource so I only create them once and use them across many BOs - they inherit from the CSLA CriteriaBase class.

Rocky recently change the way the framework works to line up the calls correctly and consistently. You can read about the changes in his blog and new eBook.

Joe

 

Maccurt replied on Monday, March 05, 2007

Thanks, I simply passed a criteria object. I will have to get the lastest greatest CSLA version and the eBook. Thanks for responding!

Copyright (c) Marimer LLC