ERL and Overriding DataPortal_Create

ERL and Overriding DataPortal_Create

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


FrazerS posted on Friday, March 05, 2010

I have a ERL which appears to be working correctly, however in order to get it to work, I found that I had to override the DataPortal_Create() method.(Which I didn't think I need to do).   If I don't do this, then when I call the NewERL() factory method, I get an exception: 

CslaDataPortalException: DataPortal.Create failed (System.NotSupportedException: Invalid operation - create not allowed... etc. etc.

Can anyone suggest why this may be the case.  I have followed the template for ERL in The Book quite carefully.  The NewERL factory method looks like this:

public

 

static MyERL NewERL()
{
    return DataPortal.Create<MyERL>();
}

Also, is it considered good practice to implement "helper" methods in the ERL class:

GetChild(int Key)
NewChild()
DeleteChild(intKey)

cheers,

Frazer

RockfordLhotka replied on Friday, March 05, 2010

There was a bug/oversight in earlier versions of CSLA where BusinessListBase didn't have a good default DataPortal_Create() method implementation. That was fixed on Sept 10, 2009, which I think means the fix is in 3.8.0 and maybe the last of the 3.7.x releases.

FrazerS replied on Friday, March 05, 2010

Thanks for the explanation, Rocky.  I am indeed using 3.6.3 - but will be updating over the next day or so. 

best regards,

Frazer

 

Copyright (c) Marimer LLC