Category: .NET Core
-
Documentation–part 6
I need 2 types of documentation: 1. For let people know how to use 2. For the programmers – to understand what the classes are doing For the first point,documentation to use a. Github has already the readme.md file that shows details for the repository . What I need is something more- i.e. detailed…
-
Devops + CI/CD-part 5
What I need for the devops: 1. Building the solution 2. Running tests 3. Deploying packages to Nuget Being part of the Microsoft stack,it is normal that I have choose for CI / CD the Azure Devops. You can see the AzureDevops at https://dev.azure.com/ignatandrei0674/WebAPI2CLI/_build?definitionId=7&_a=summary and how it is done by reading https://github.com/ignatandrei/WebAPI2CLI/blob/master/azure-pipelines.yml Seeing code coverage…
-
Create and running tests- part 4
I have made a TestWebSite,in .NET Core 3.1,I was also thinking that WebApplicationFactory exists and tutorial like https://docs.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-3.1 it will be easy to test the site. However,I have found the hard way that is not a real server : it does not have the adresses / ports open. Read https://github.com/dotnet/aspnetcore/issues/4892 . So I have made…
-
Implementing–part 3
First implementation was just a bunch a code thrown in an API project. All self contained,all in one WebAPI project. Some problems that I have faced: 1. The class that executes( the hosted service ) should have access to the address of the server . However,the class is injected at the moment of creating…
-
Thinking of the project–part 2
The questions that I have to solve is : 1. How to run something in an ASP.NET Core project,when we have just WEBAPI controllers ? The answer was pretty simple: Hosted Services: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services?view=aspnetcore-3.1&tabs=visual-studio . It runs unattended and can be started by the project 2. Which version of .NET Core should I use ? Another…
-
New side project- WebAPI To CLI–part 1
I have had an idea; What if the WebAPI application can be called from the console application itself ? This will permit just having the DI running – and all the stuff that WebAPI can work with when calling a controller. Will be good in a CI / CD workflow – testing the full API…
-
.NET Core Multiple Authentication–Windows AD,Azure AD,Database
I was having a project about how to do in .NET Core multiple authentication: Windows AD,Azure AD,Database – and integrate with Roles. It was an interesting project – and I decide to not make everything – but to construct on an existing project. The most promising sounds IdentityServer – with the Federation Gateway. : http://docs.identityserver.io/en/latest/topics/federation_gateway.html…
-
Caching data backend–.NET Core–part 49
We have 2 options to cache data: One in webAPI,one when returns from database. For WebAPI,I have read https://docs.microsoft.com/en-us/aspnet/core/performance/caching/response?view=aspnetcore-3.1 and https://docs.microsoft.com/en-us/aspnet/core/performance/caching/middleware?view=aspnetcore-3.1 It is also important to read the conditions for caching : https://docs.microsoft.com/en-us/aspnet/core/performance/caching/middleware?view=aspnetcore-3.1#conditions-for-caching ( e.g. only GET or HEAD is cached) It is just very easy – see github commit https://github.com/ignatandrei/InfoValutar/commit/b8d38658b5135e4d3c93da78f77ffb9f01376829 Also,can be tested by…
-
Routing angular with .net core and RxJs switchmap- part 46
Now the problem is that the route works if I access first the index.html file,but it does not route when entered directly Trying to get from SPATemplate https://github.com/ignatandrei/InfoValutar/commit/a364dc57653ac2ba04ab0596f1540a8f9fdb73f6 However,this will redirect ALL routes to index.html – including swagger and API. Trying to learn more – looking at the code. I have observed that I…
-
.NET Core 3.0 to .NET Core 3.1 and .NET Core SSL (https )with VSCode + Docker –part 44
To pass from .NET Core 3.0 to .NET Core 3.1 Modify the .csproj Modify the devops Modify the GitHub Actions Modify the Azure Devops ( because was on Docker,just modify the docker FROM sdk Modify the dockerfile in the .devcontainer folder to run in VSCode Container Some of the modifications here : https://github.com/ignatandrei/InfoValutar/commit/2d5b138ccd6225a6bf69dca47fe76e2270920d2d However,to have…