bumpy-grass-54508
02/17/2023, 12:07 AMConfigure
? in Configure
i read in the provider inputs, build up my implementation-specific http client pointed at my custom API, and store that to a private instance field. then later in Create
and Delete
i attempt to use the http client to actually perform the actions i need to.
however, i am seeing the client is null during Create, and after some logging i see that my Provider class is being instantiated several times but only once Configuredechoing-dinner-19531
02/17/2023, 9:17 AMif that is the case, is it safe to just store my provider-specific http client inside a private static field? seems like each provider instance may be isolated in different .net processesprivate instance fields should work. I'll look into this for you! The intention is supposed to be your "Provider" object gets created once when the engine attaches, then the engine call configure allowing you to set up any instance state, and then everything else gets called. I have probably just screwed something up in the AspNet DI layer and not told it that providers should be singletons. For the time being static state will probably be a good workaround, the engine will start a whole new process for each provider instance it sees so you should be safe using static state.
bumpy-grass-54508
02/17/2023, 12:17 PMechoing-dinner-19531
02/18/2023, 12:19 PMbumpy-grass-54508
02/20/2023, 3:22 PM