CSLA 4.2.2: DataPortal.Create Failed

CSLA 4.2.2: DataPortal.Create Failed

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

cjherasmus posted on Monday, April 16, 2012

I'm using the Encapsulated Invoke DTO method, EF and SL (UI).

I have a stored procedure that joins several tables which accepts an Id parameter of type Guid. It returns a list of records per Id. I've mapped the stored procedure with EF in VS2010 via Function Imports.

If I pass the Id parameter to the ROLB BO, I get the error: "DataPortal.Create failed, Invalid operation - create not allowed at Csla.ReadOnlyListBase.DataPortal_Create(Object criteria)".

I have other ROLB and NVL which all works correctly but they don't use parameters.

I'm not sure why Create is called in the ROLB.

JonnyBee replied on Monday, April 16, 2012

Make sure that your static factory method call

DataPortal.Fetch  - not DataPortal.Create.

cjherasmus replied on Monday, April 16, 2012

Thanks Jonny, just needed a extra pair of eyes :-)

Copyright (c) Marimer LLC