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

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

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: 335

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,237
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: 51

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

#5 2024-02-28 12:47:20

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

Re: Where is CurrentServiceContext in mORMot 2?

Hello.. I still can't find the NamedPipe server, can someone please point me in the right direction or confirm it is not available anymore?

Thank you.

Offline

#6 2024-02-28 13:56:25

igors233
Member
Registered: 2012-09-10
Posts: 234

Re: Where is CurrentServiceContext in mORMot 2?

Check: https://synopse.info/forum/viewtopic.php?id=6415

Last edited by igors233 (2024-02-28 13:56:37)

Offline

#7 2024-02-28 14:04:13

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

Re: Where is CurrentServiceContext in mORMot 2?

Thanks igors233, now I can move on big_smile

Offline

Board footer

Powered by FluxBB