Category: projects
-
NetCoreUsefullEndpoints-part 8- adding start date
In my NuGet NetCoreUsefullEndpoints package I have had already registered the actual date as var rh = route.MapGet(“api/usefull/dateUTC”,(HttpContext httpContext) => { return Results.Ok(DateTime.UtcNow); }); Now I want to register also the start date – the date where the application has been started. 1. How to do this ? 2. What will be the route ? For…
-
NetCoreUsefullEndpoints–part 7–restart application
In order to do the shutdown,I have added the following extension public static CancellationTokenSource cts=new (); public static void MapShutdown(this IEndpointRouteBuilder route,string? corsPolicy = null,string[]? authorization = null) { ArgumentNullException.ThrowIfNull(route); var rh = route.MapPost(“api/usefull/shutdown/”, (HttpContext httpContext) => { var h= cts.Token.GetHashCode(); cts?.Cancel(); return h; }); rh.AddDefault(corsPolicy,authorization); } This code defines a…
-
DIForFunctions – Improving constructor–part 5
I have received a suggestion : what if we just put into constructor what we need,and everything else ( such as ILogger ) are into fields ? The Roslyn Source Code Generator will generate a constructor that calls the this constructor and will assign fields needed. Let’s give an example : We wrote public partial…
-
Record visitors- work on issues–part 7
Now it is time to solve some issues There were 12 issues written by me – you can see here: https://github.com/ignatandrei/RecordVisitors/issues?q=is%3Aissue+is%3Aclosed Between the most important: Improve readme.md with more links and explanations for potential programmer and contributors Write version in static constructor – to know about the version,if some issue occurs Added custom link lastvisitors/minutes/{time:int}…
-
SideCARCLI–Finish process after some time
One of the feature is to let the original process execute just a limited amount of time. For this,I have defined an option var maxSeconds = app.Option(“-mS|–maxSeconds”,”max seconds for the StartApp to run”,CommandOptionType.SingleOrNoValue); and the code for waiting is Process p = new Process() { StartInfo = pi }; //code var res=p.WaitForExit(this.MaxSeconds); //code if (res)…
-
SideCarCLI – Line interceptors
For the SideCarCLI I have the concept of Line Interceptors. That means for each line from the original program another program will be start . The json looks like this “LineInterceptors”: [ { “Name”: “WindowsStandardWindowsOutputInterceptor”, “Arguments”: “/c echo \”{site} {line}\””, “FullPath”: “cmd.exe”, “FolderToExecute”: null, “InterceptOutput”: true }, { “Name”: “NextInterceptor”, “Arguments”: “/c echo {line}”, “FullPath”:…
-
SideCarCLI | Command Line – description –part 1
There are those days a great deal of command line applications that performs a variety of things. The problem is that you cannot control them . The command line performs their duty well – but,from time to time,you need something else integrated with this. The pattern for this is https://docs.microsoft.com/en-us/azure/architecture/patterns/sidecar – it is applied to…
-
Full Projects
My first blog post in English is from 14 nov 2009 ( http://msprogrammer.serviciipeweb.ro/2009/11/14/jquery-learning/ ). It was on the time that Jquery was just integrated in VS 2010. My first blog post about programming was from 13 March 2005 (http://serviciipeweb.ro/iafblog/2005/03/13/pentru-inceput/ ). I was working on “ log4Net,NUnit,C#,asp.net,VB.Net sai VB6” ….. From the old blog in Romanian,those…
-
YouTube playlist exporter
The point here is about how simple is in our days to make a simple script as a programmer. I wanted to export my playlists ( 5 minutes .NET,Export Word Exce l PDF ,EF 6,Traceability ) videos into a simple HTML file that I could put into my website. I searched first on internet –…
-
MVC planning poker -Test driven development and Version control and Continuous Integration– foundation – 2
After setting the use cases,I have now think about code. ( Ok,maybe it should be first architecture,but I am a programmer first ) So I start to code the first Use case : Running the test was a no-brainer – it does not even compile. And it is good,according to https://msdn.microsoft.com/en-us/library/aa730844(v=vs.80).aspx Now I want to…