#1 2024-02-12 18:30:24

imperyal
Member
Registered: 2018-10-11
Posts: 36

Where is CurrentServiceContext in mORMot 2?

Hello,

I need some help, probably something very basic...

I'm currently refactoring our code to use mORMot version 2 and I can't find the function CurrentServiceContext (previously found on the mORMot.pas unit) to get the TServiceRunningContext.


Thank you.

Offline

#2 2024-02-12 19:37:30

tbo
Member
Registered: 2015-04-20
Posts: 328

Re: Where is CurrentServiceContext in mORMot 2?

imperyal wrote:

I'm currently refactoring our code to use mORMot version 2 and I can't find the function CurrentServiceContext (previously found on the mORMot.pas unit) to get the TServiceRunningContext.

Unit mormot.rest.server
ServiceRunningContext, or better use TInjectableObjectRest for Interface-based Services.

With best regards
Thomas

Offline

#3 2024-02-13 08:20:45

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,134
Website

Re: Where is CurrentServiceContext in mORMot 2?

Yes, this was renamed for consistency.
And was already found confusing by some users.

I have added added a wrapper in not PUREMORMOT2 mode:
https://github.com/synopse/mORMot2/commit/8c379806

And Thomas is right, using TInjectableObjectRest is a cleaner approach - if you can.

Offline

#4 2024-02-16 16:15:46

imperyal
Member
Registered: 2018-10-11
Posts: 36

Re: Where is CurrentServiceContext in mORMot 2?

Thank you for this, it is working.

I did miss another thing... The NamedPipe server... It is not available anymore?

Offline

Board footer

Powered by FluxBB