It would be safer if you change your code, as you are using it in a way that is always subject to change/break. Manager.CreateCriteria
is safer.
Is it feasible for you to change? Or, is it feasible to you to add a unit to uses clause to add a helper? This way a helper class could be created to add an overloaded Create
. The equivalente code would be something like this:
constructor TCriteriaHelper.Create(Clazz: TClass; Manager: TMappingExplorer);
begin
Create(Manager.Explorer.EntityTypeFromClass(Clazz), Manager);
end;