#1 Re: mORMot 2 » Question About Passing TOrmClass in Service Function Causing Access Vi » 2024-08-05 09:01:36

So, every time in the implementation, I need to do a case statement for each class like this:

case ClassType of
  User: DoSomething;
  Product: DoSomethingElse;
  ...
  ClassNumber15: DoAnotherThing;
  ...
end;
Is there a way to check which class is in the parameter and process it directly without having to check all cases one by one?

#2 mORMot 2 » Question About Passing TOrmClass in Service Function Causing Access Vi » 2024-08-05 08:20:03

youssef
Replies: 3

How can I create a function in a service that contains a parameter var aClass: TOrmClass and use it in a test unit? When I try to implement this, I encounter an access violation error. Could you please advise on the correct approach or what might be causing the issue?
function

Board footer

Powered by FluxBB