The expected method is to use the Criteria object. You would define your own object inheriting from CriteriaBase that includes properties for whatever parameters you need to pass. In the DataPortal_Create(object criteria) method, you'll cast the criteria object to your type and access the properties.
Here's an example of how you'd do this:
public void MyObject NewOne(string parentValue)
{
return DataPortal.Create<MyObject>(new MyCriteria(parentValue));
}
protected override void DataPortal_Create(object criteria)
{
string parentValue = ((MyCriteria)criteria).ParentValue;
// Rest of code
}
HTH
You can pass the criteria object to your DataPortal_Create(). However, there is no overridable DataPortal_Create(object criteria). Instead, the framework will search for a method of name DataPortal_Create(Criteria cri), which takes an argument.
[Serializable]
public class MyObject
{
[Serializable]
private class Criteria
{
public readonly string ParentValue;
public Criteria(string parentValue)
{
this.ParentValue = parentValue;
}
}
private string _parentValue;
public static MyObject NewMyObject(string parentValue)
{
return DataPortal.Create<MyObject>(
new Criteria(parentValue));
}
private void DataPortal_Create(Criteria cri)
{
_parentValue = cri.ParentValue;
...
}
}
Hope this helps.
Regards,
William
Copyright (c) Marimer LLC