Visual Studio Code – Cancel task in c#
I´m still learning to code, and I'm making a new project with MDI forms (C# and Visual Studio 2019). In mdichild, I launched a task, but if the form is unloaded, the task still remains. I would like to know…
I´m still learning to code, and I'm making a new project with MDI forms (C# and Visual Studio 2019). In mdichild, I launched a task, but if the form is unloaded, the task still remains. I would like to know…
I have a quartz job that runs once in 30 days in my ASP.NET application. The job loops through and passes the data to the API which in turn fetches JSON data. I am trying to store the data in…
I'm switching tech stacks so I'm a bit confused here. This function should return an object public async Task<IActionResult> Search(CoinModel Coin) { var date = Coin.tracking_date.ToLocalTime().ToString("dd/MM/yyyy"); var dateformat = DateTime.Parse(System.Web.HttpUtility.UrlDecode(date + " 00:00:00.0000000")); var issue = await _db.Coins.SingleOrDefaultAsync(c => c.coin…
I just tried to make an API app in SwiftUI with loveCalculator from rapidapi.com The problem is that API first needs names from me before it gives me the results. My program works but fetching data form API earlier that…
Currently I have a code like this: bool task1Result = await RunTask1(data); if(!task1Result) return false; bool task2Result = await RunTask2(data); if(!task2Result) return false; bool task3Result = await RunTask3(data); if(!task3Result) return false; bool task4Result = await RunTask4(data); if(!task4Result) return false; Added…
In code of my colleagues I've noticed code like this: private Task FetchAllKeysFromRedis(List<string> keys, ConcurrentBag<RedisModel> resultsBag, CancellationToken cancellationToken) { var parallelism = Environment.ProcessorCount; var semafore = new SemaphoreSlim(initialCount: parallelism, maxCount: parallelism); var tasks = new List<Task>(); foreach (var key in…
I'm trying to write a simple string from the user-agent request headers in to the browser. var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); app.MapGet("/", (context) => return context.Request.Headers["User-Agent"].ToString();); app.Run(); This gives a compile error Cannot convert expression type 'string'…
I have a problem. So I have a task that runs every time when a user writes a chat message on my discord server - it's called on_message. So my bot has many things to do in this event, and…
We have an ecs task that looks for an image with the :latest tag and deploys that image into our cluster. One of the :latest images were problematic so we deleted it hoping aws might be smart enough to tag…
I'm using Visual Studio Code (VSCode) for a bigger project where we have around 10 to 15 sub git projects in one workspace. All these projects are Typescript so I use tasks.json + vscode Option Tasks: Manage Automatic Tasks in…