Calling MyBase.DataPortal_Create()

Calling MyBase.DataPortal_Create()

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


lazaroms posted on Tuesday, April 05, 2011

Hi All:

I'm working in CSLA 3.6.

 

When do I need to call MyBase.DataPortal_Create() in the Create method? And when not?

Thanks,

 

Lazaro Manuel

RockfordLhotka replied on Wednesday, April 06, 2011

The base implementation just calls ValidationRules.CheckRules (and in CSLA 4 it calls BusinessRules.CheckRules).

That's all it does in .NET.

In Silverlight/WP7 the base implementation also invokes the async callback for you.

So you should call the base method if you want the business rules to be run, and (in Silverlight) the async callback invoked. Otherwise don't call it.

As a general rule, you do want the rules run, and the callback invoked, so usually you will call the base method as the last line in your override.

Copyright (c) Marimer LLC