A simple ASP.Net Core Web API with a Simple Service
Project description
The API provides a functionality to create and read a value from the server. Purpose of the project is to demonstrate how the values can be persisted in the server memory using singleton objects.
POST method creates a value in the serverGET method reads boack the value from the server Sourcode The complete source code of the project can be found in GitHub at https://github.com/sureshatt/aspdotnetcore-proj/tree/master/APIWithService
Running the project Run the project in Visual Studio.
The application will start in port 65387 due the configuration in the Program.cs file.
Consuming APIs
Use the postman collection in the project https://github.com/sureshatt/aspdotnetcore-proj/blob/master/APIWithService/APIWithService.postman_collection.json
Analysis Startup.cs In the Startup.cs the service.AddSingleton() method is used to inject the MyTyle singleton object.
IMyType.cs Is the type which defines the mecahanism to store and read value from the server meomey.
MyType.cs Im…
POST method creates a value in the serverGET method reads boack the value from the server Sourcode The complete source code of the project can be found in GitHub at https://github.com/sureshatt/aspdotnetcore-proj/tree/master/APIWithService
Running the project Run the project in Visual Studio.
The application will start in port 65387 due the configuration in the Program.cs file.
Consuming APIs
Use the postman collection in the project https://github.com/sureshatt/aspdotnetcore-proj/blob/master/APIWithService/APIWithService.postman_collection.json
Analysis Startup.cs In the Startup.cs the service.AddSingleton() method is used to inject the MyTyle singleton object.
IMyType.cs Is the type which defines the mecahanism to store and read value from the server meomey.
MyType.cs Im…