When creating a IServiceInitializer remember to inject a RequestContext using it's parameterless constructor. This is used to notify users they must call Microservice.AssumeUser before attempting to use certain user-specific routes.
More...
|
TService | GetServiceAsCache< TService > () |
| Gets a service registered during BeamableMicroService.InitServices. If you intend to cache data on the service, you must use a singleton service for that. This method can be used to explicitly guard against mistakenly getting a non-singleton service for cache-ing purposes. Functionally, there is no difference between this and GetService<TService>. There's just a guard baked in that you can use to declare that a specific service is being used as a Cache and, therefore, must have been added via IServiceBuilder.AddSingleton<T>(Beamable.Server.ServiceFactory<T>) or IServiceBuilder.AddSingleton<T>(). More...
|
|
TService | GetService< TService > () |
| Gets a service registered during BeamableMicroService.InitServices. This assumes nothing about what you are using the service for and only guards against attempting to get a non-existent service. More...
|
|
When creating a IServiceInitializer remember to inject a RequestContext using it's parameterless constructor. This is used to notify users they must call Microservice.AssumeUser before attempting to use certain user-specific routes.
◆ GetService< TService >()
TService Beamable.Server.IServiceInitializer.GetService< TService > |
( |
| ) |
|
Gets a service registered during BeamableMicroService.InitServices. This assumes nothing about what you are using the service for and only guards against attempting to get a non-existent service.
◆ GetServiceAsCache< TService >()
TService Beamable.Server.IServiceInitializer.GetServiceAsCache< TService > |
( |
| ) |
|
Gets a service registered during BeamableMicroService.InitServices. If you intend to cache data on the service, you must use a singleton service for that. This method can be used to explicitly guard against mistakenly getting a non-singleton service for cache-ing purposes. Functionally, there is no difference between this and GetService<TService>. There's just a guard baked in that you can use to declare that a specific service is being used as a Cache and, therefore, must have been added via IServiceBuilder.AddSingleton<T>(Beamable.Server.ServiceFactory<T>) or IServiceBuilder.AddSingleton<T>().
The documentation for this interface was generated from the following file:
- com.beamable.server/SharedRuntime/ServiceInitializer.cs