Developing a simple Windows system tray desktop app to consume a .NET web service

Keep it all in .NET. You can easily write a Windows Forms application to display a tray icon and display notifications as and when something happens in the web service (you’d probably need a timer to do the polling). There are plenty of articles around that will show you how to do this. Here’s one … Read more

Mark strings as non-nullable in ASP.NET Core 3.0 Swagger

You can now use nullable reference types to mark strings as optional or required: Enable nullable reference types for your project/solution Mark strings in Dtos as nullable: public class ExampleDto { [StringLength(64, MinimumLength = 4)] public string RequiredString { get; set; } [StringLength(200)] public string? OptionalString { get; set; } } Enable Swagger support in … Read more

Multiple statements in a switch expression: C# 8 [duplicate]

Your only supported choice is the func like you did. See [this article][1] for more information. His example: var result = operation switch { “+” => ((Func<int>)(() => { Log(“addition”); return a + b; }))(), “-” => ((Func<int>)(() => { Log(“subtraction”); return a – b; }))(), “/” => ((Func<int>)(() => { Log(“division”); return a / … Read more

stdout vs console.write in c#

In languages like C and C++, there is a global variable with the name stdout, which is a pointer to the standard output stream. Thus, stdout has become a commonly used abbreviation for “standard output stream” even outside the context of the C language. Now, what does C# do? Let’s have a look at the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)