Nat’s 2022 Technical Link Pile: C# and .NET

December 30, 2022 – 7:07 pm

See the Intro for context. (We’re hiring WinForms seniors! Mail me: nat@ontempo.co.nz)

[20221224] How to Structure Your .NET Solutions: Architecture and Trade-Offs – what it says on the box.

[20221224] DocFx – generate static documentation site from embedded XML documentation.

[20221224] .NET Advent Calendar – most are interesting, though they’re so diverse it’s the rare person who’d be interested in all.

[20221210] ComputeSharp – run C# on the GPU.

[20221210] NLua – .NET Lua interpreter.

[20220719] Lambdas in C# – quick overview of syntax.

[20220525] Winforms UI Refactoring: A Case Study – brief, just about using their dependency mapping tool to figure out coupling.

[20220525] Moving Your Xamarin Library to MAUI – rewrite/refactor/bifurcate; understand your dependencies; upgrade CSPROJ; implement single-project multitargeting; fix problems caused by dependencies or .NET version shifts; keep same filenames to ease merging.

[20220519] Life Cycle Events in MAUI – Running, Not Running, Deactivated, Stopped are the states, and there are events you can receive when you move between the states.

[20220330] Parameter Null Checking in C# 11 – !! on a parameter name in the definition automatically performs null checking.

[20220330] Polly – a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, Rate-limiting and Fallback in a fluent and thread-safe manner.

[20220324] Raw String Literals in C# – stolen from Perl which stole it from the Bourne shell, I think.

[20220323] Populating an Array with the Same Value – for() loop is slow but does deep copy; Enumerable.Repeat is faster and lets us say how many copies of a value we get; Array.Fill is fastest but has no option for partial fill.

[20220323] Params in C# – get function parameters in an array instead of naming them in the function definition.

[20220323] Accessible MAUI Apps – Screen reader assistance; Colors and contrast; Size; Keyboard navigation; Writing or icon representation.

[20220323] RestSharp – HTTP client library with automatic serialization and deserialization, request and response type detection, variety of authentications.

[20220323] DI in AWS Lambda functions in C# – building an API with Lambda functions in C#, using dependency injection which apparently required some research.

[20220317] Telerik Reporting – huh, they have their own SSRS type thing? Now it’s in React as well.

[20220317] C# DateTime Formats – far more than you ever wanted to know about formatting datetimes.

[20220317] Inequality Operators – “is not” requires constant expression on RHS, but does boxing and understands inheritance. “!=” doesn’t need constant expr RHS, but will fail if types are different and doesn’t understand inheritance. Consequently errors are different (cannot be applied vs cannot convert). “!=” can be overloaded, “is not” can’t be.

[20220314] 10 .NET Packages Every Developer Needs to Know – they are:

  • Quartz.Net – scheduling
  • Serilog – logging library, lots of pre-written integrations
  • Automapper – copy data from one object structure to another, groks conventions like property names
  • Polly — allows developers to express policies when handling API calls, like retry, fallback, rate-limiting etc.
  • FakeItEasy — creates fake objects, mocks, stubs, and more.
  • XUnit — unit testing framework by authors of NUnitv2
  • FluentValidation — strongly-typed validation rules.
  • FluentAssertions — extensive set of extension methods to specify the expected outcome of a unit test.
  • Autofac — IoC container for .NET applications, with API and module system.
  • Noda Time — date and time API. E.g., date and time in a specific timezone.
  • SharpZipLib — compression library.
  • HtmlAgilityPack — HTML parser in C#.
  • MailKit — SMTP, IMAP, POP3.

[20220225] Const vs ReadOnly vs Static ReadOnly — const = compile time; readonly = can only set value in constructor; static readonly = only static methods can change the variable.

[20220217] WASM WinForms –  nuget package that you can install and use your codes unchanged and run it on your browser!

[20220213] Bionic Framework — using the Ionic Capacitor framework for xplat apps (which comes highly recommended) but with C# and Blazor.

[20220203] Guard class in Diagnostics toolkit – simplify parameter checking

[20220203] int.Parse(), Convert.ToInt32(), and int.TryParse() – behaviour on non-int strings. Parse() throws exceptions, ToInt32() returns 0. TryParse() returns two values, success and parsed value.

[20220128] .NET Analyzer rules in Visual Studio

[20220201] .NET testing with xUnit

[20220201] Developing and shipping a working .NET 5 application including deployments, devops, migrations, and Linux

[20220201] Platform-specific code in MAUI (video)

[20220201] Building an event-driven .NET application

[20220201] DateTime to ISO8601 in C#

[20220201] Upgrading Xamarin Forms to .NET MAUI

[20220201] C# “is” and “as” operators

  • “is” compares types
    • foo.GetType() == typeof(SomeClass) // exact only
    • foo is SomeClass // understands inheritance
  • “as” converts types
    • var x = foo as SomeClass; // x is of type SomeClass, or is null if invalid conversion

[20220201] Records in C#

[20220201] C# structs vs records

[20220201] .NET Architecture Guides

[20220201] Installing .NET Maui on macOS

[20220201] Advanced Data Binding

[20220201] Deep C# book

You must be logged in to post a comment.