/Advanced-Csharp-topics

In this repository I will try to explain good concepts regarding Async, regarding Logging and so on

Primary LanguageC#

Advanced C# topics and pieces of advice.

Practical Part

In this repository I will try to explain good concepts regarding Async, regarding Logging and so on.

Covered topics
☑ Async
☑ IAsyncEnumerable. Async Streams and when to use async before foreach

  • Async materials are here: Async materials
  • Async void pitfalls (in progress)

☑ Logging in minimalAPI:

☑ Nullable Reference Types

☐ Prevent from decompiling your C#-application
☐ Validation. Settings Validation

Authentication using JWT
☑ Authorization

.editorconfig

☑ Worker (CPU-bound) & Completion (I\O-bound) Threads Worker & CompletionThreads.pptx
☐ GC, IDisposable, and Finalizer (in progress) GC and related materials are here:

ReadOnlySpan, ref struct and how to not allocate extra memory in heap
PeriodicTimer, modern way how to run background tasks
☐ Delegates. Delegates use cases in C#10
☑ Benchmarks

☐ Benchmarking WebAPI and GC utilization in it. CQRS Cost.

☐ Data Structures

☐ Reflection and its performance in modern C#. Dynamic as "Instead of Reflection"

  • Dynamic in modern C# (in progress)
  • Reflections and its performance in NET8 Preview (in progress)

☑ Console App with Generic Host. Running application from the pipeline. (useful for DB Migration)

Allows to run any Tasks and use Host services lifetime. Might be useful to run EF DBMigrations from Pipeline or from another place https://dfederm.com/building-a-console-app-with-.net-generic-host/

☐ EntityFramework vs Dapper. Improving speed of EntityFramework (in progress)
☐ Kafka meets .Net6 (in progress)
GraphQL meets .Net6
☑ Bloom Filter (in progress. Could be found below)

Bloom Filter. Pros and Cons. Types. Use Cases

Use Cases

image

Pros

image

Cons

image

Dynamic. Performance. Comparison

☐ Retries in .Net
☐ String.Create (example from Dave is in the section below)

String.Create example (let us not allocating extra space when we tend to construct the string). Faster than String.Join and String Interpolation

image