Is There an OnStart Event Handler for Webservices?

Julio Bello 221 Reputation points
2021-04-07T02:59:06.317+00:00

Hi, Everybody!

I have several webservices created/written under one single Visual Studio project, WebServices. This was an "inherited" design. Personally, I would have managed each of them under their own project and deployed them separately. As it stands, all gets deployed together.

I want one of the webservices in particular to load data on start-up and persist throughout its lifetime, using the data to handle its own requests, until the next restart or shutdown. I want the other webservices to be unaware of this data. I wish to keep it hidden from the other webservices.

Does each webservice have its own OnStartup event handler?... If not, what is the best way to implement this? Should I create a singleton base class that loads the data and makes it accessible only to the derived webservice in question? Are there other better approaches?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,105 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,296 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.