Application services for ASP.NET Core applications.
This package is hosted on Myget on the following feed : https://www.myget.org/F/digipolisantwerp/api/v3/index.json.
To add it to a project, you add the package to the csproj file :
<ItemGroup>
<PackageReference Include="Digipolis.ApplicationServices" Version="3.1.1" />
</ItemGroup>
or if your project still works with project.json :
"dependencies": {
"Digipolis.ApplicationServices": "3.1.1"
}
In Visual Studio you can also use the NuGet Package Manager to do this.
To use the library's services, you add them in the Configure method of the Startup class :
services.AddApplicationServices(options => {
options.ApplicationId = "a0eab541-0f09-4540-abbf-88cc1fe02a90";
options.ApplicationName = "MyApplication";
});
You can inject the IApplicationContext in your objects to have access to the application's identification. The context provides the following properties :
- ApplicationId : the application's unique id (given in the startup options).
- ApplicationName : the application's (friendly) name (given in the startup options).
- InstanceId : the unique id of the application's running instance (is generated at startup).
- InstanceName : the name of the application's running instance (is generated at startup).
- ApplicationVersion : the application's version.
- InternalApplicationName : the application's internal name (the name of the .NET Core project).
In a load-balanced, scalable environment, you will run several instances of the same application. The instance properties can be used to identify each instance of this application (e.g. in logs).
coming soon.
Pull requests are always welcome, however keep the following things in mind:
- New features (both breaking and non-breaking) should always be discussed with the repo's owner. If possible, please open an issue first to discuss what you would like to change.
- Fork this repo and issue your fix or new feature via a pull request.
- Please make sure to update tests as appropriate. Also check possible linting errors and update the CHANGELOG if applicable.
Marc Wouters ([email protected])