Someone at my company was using
DataPortal.Delete(SingleCriteria<T, C> foobar);
And it worked as expected :)
But somewhere else at his learningcurve he made a own criteria class derived from CriteriaBase which he uses for several situations in multiple business objects. Then he wrote:
He kinda forgot to use the generic DataPortal.DataPortal.Delete(new MyCriteriaClass(param1, param2));
public static void Delete(object criteria)
{
Type objectType = MethodCaller.GetObjectType(criteria);
Delete(objectType, criteria);
}
ajj3085:MyCriteriaClass should be inheriting CriteriaBase, and it should be calling the constructor and giving it the type there. That's typically what I do, but maybe its not required if you simply add the type between the end of the method name and the opening (.
DataPortal.Delete( new MyCriteriaClass )
Copyright (c) Marimer LLC