#Csharp
52 notas · última:
Functional Programming (F#) for C# Developers
The article explains core functional programming ideas and shows how C# can express them through immutability, pure functions, composition, and LINQ, with F# presented as the .NET functional language.
Functional Programming in C#—A Brief Consideration
The post introduces functional programming in C# as a way to reduce complexity, relying on pure functions, immutability, LINQ, and higher-order functions to make code easier to understand, debug, and test.
Liskov Substitution Principle in C# with Example
The page explains LSP with a Bird/Ostrich example, shows how overriding Fly in Ostrich breaks substitution, and refactors the design around IBird and Move so each bird type behaves correctly.
Devs: Don’t Just Read About Design Patterns, Implement Them
The post argues that design patterns are more useful as examples you build than as theory you read. A contrived C# animal-mission setup shows how decoupling lets missions, heroes, and lairs vary independently.
Preventing SQL injection in C# with Entity Framework
The page explains how SQL injection happens, why string concatenation is risky, and how Entity Framework reduces that risk with LINQ, FromSqlInterpolated, and explicit parameters in FromSqlRaw.
Mastering C# Pattern Matching
The post reduces a lock gate example to a C# switch expression with pattern matching. It shows how underscores replace repeated cases and how invalid states still throw exceptions.
EP 66: Clean Code Tips for .NET Developers - Part I
The post argues that clean code in .NET comes from meaningful names, avoiding null returns, keeping classes focused, limiting method size, reusing existing tools, and enforcing shared rules with EditorConfig and project settings.
More Testing Tips With C#
The post shares testing tips for C#: generating fake data with Faker.NET or Bogus.NET, using seeds to reproduce randomized tests, comparing output against reference files, and finding free ports or loopback IPs for integration tests.
Anatomy of the .NET dictionary
Explains how .NET Dictionary stores entries in buckets and arrays, handles collisions with chaining, reuses freed slots, and grows or trims capacity.
Secret Productivity Tips for Visual Studio 2017
The post lists Visual Studio 2017 features that are disabled by default, showing where to enable them and how they help with search, analysis, unit testing, style enforcement, and shortcuts.
Understanding IQueryable<T> in C#
The post explains IQueryable as a LINQ interface with deferred execution, expression trees, provider translation, and extension methods for composing filtering, sorting, pagination, and execution.
Default Interface Implementations in C#: Where Inheritance Goes to Troll You
Default interface implementations in C# can change behavior when a class gains a base class. The article shows why a service starts returning the interface default and suggests ways to avoid it.
Dependency Injection made simple
The page explains dependency injection as passing an object to the constructor or setter of a dependent class, which decouples the code, makes testing easier, and uses interfaces in strongly typed languages.
This Is Why We Don't Test Private Methods
The post argues that private methods should be tested indirectly through public behavior, because direct tests break encapsulation and expose internals that other code should not use.
Boosting Performance With Sealed Classes in .NET
The article compares open and sealed classes in C# and shows gains in performance in method calls, casting, type checking, and arrays, with an exception for static methods. It also points out the cost for mocking in tests.
Proxy Design Pattern in C# - Code Maze
The Proxy pattern adds a wrapper around a real object to control access and add logic without changing the original service. The article shows a caching proxy in C# and mentions logging, protection, remote, virtual and selection proxies.
Chain of Responsibility Design Pattern in C#
The article explains the Chain of Responsibility pattern in C#, shows the middleware case in ASP.NET Core, and refactors a book loan flow into chained handlers.
Advanced Debugging in C#
The article shows advanced debugging techniques in Visual Studio 2022 for C#: conditional breakpoints, tracepoints, hit count, filters, code editing, execution pointer, object IDs and string visualizer.
3 Essential Techniques for Managing Transactions in EF Core
Compares three ways to wrap EF Core writes in a transaction: automatic per-call, manual begin/commit/rollback, and execution-strategy transactions that retry on transient failure.
C# 14 Extension Members: Extension Everything
C# 14 finally ships the long-requested 'extension everything' feature: static extension methods, static and instance extension properties, and eventually operators.
Replacing Exceptions-as-flow-control with the Result Pattern
Andrew Lock walks a C# service through three stages — exceptions for flow control, a basic Result<T>, and a safer Switch()-based Result<T> — showing why each trade-off matters.
Building High-Performance .NET Apps With C# Channels
A practical rundown of bounded vs. unbounded C# Channels, a bounded-channel background processor, and a write-back caching pattern for a shopping cart.
Build a Model Context Protocol (MCP) Server in C#
James Montemagno walks through the C# SDK for MCP, from a two-line echo tool to a real Monkey MCP server with data, container publishing, and SSE transport.
A complete guide to async programming in C#: understand threading, non-blocking I/O, await behavior, and best practices with ConfigureAwait
Stalin walks through what async/await does under the hood in C#, from thread pooling and await's resume point to SynchronizationContext, ConfigureAwait(false), and CancellationToken.
Mastering the C# Dispose Pattern
The guide explains how .NET manages reference types with the GC, why unmanaged resources need manual cleanup, and how to apply simple, full, inherited, and async dispose patterns correctly.
Logging Performance Improvements with Source Generators in C# .NET
The post explains how source-generated logging in .NET uses `LoggerMessage` on partial methods to reduce overhead, improve type safety, cut boilerplate, and keep log messages consistent.
Muhammad Waseem (@mwaseemzakir) on X
Explains the C# yield keyword as a way to support custom stateful iteration over .NET collections, returning IEnumerable lazily and noting basic restrictions on where yield can be used.
Solid Principles Simplified (C#, .Net 5)
The article explains SOLID as a set of design principles that improve readability, changeability, extensibility, scalability, maintainability, and loose coupling in C# and .NET 5 code.
Pattern Matching in C#
The article explains pattern matching in C# as a way to replace nested conditionals with clearer checks on type, value, ranges, properties, tuples, and stored results.
The setup "trick" that .NET libraries use and you should too
Nick says the video shows a C# feature that is not obvious at first glance and is used widely by ASP.NET Core and other .NET libraries to simplify how configuration details and settings are provided.
JArray.SelectTokens Examples
The page shows C# examples of JArray.SelectTokens with JSONPath queries for nested properties, scans, wildcards, slices, index lists, and value filters over arrays.
C# attributes you should know #2: [DebuggerStepThrough] and [DebuggerHidden]
The post explains how [DebuggerStepThrough] lets code run without being debugged, how [DebuggerHidden] hides code from the debugger, and how they differ in the Call Stack.
Bubble Sort In C#
The article explains how bubble sort works in C#, shows a basic implementation and an optimized version with early exit, and compares their O(N²) behavior with benchmark results.
Roman To Numbers To Roman in C#
The page explains how to convert Roman numerals to integers by comparing current and next symbols, then shows two ways to convert integers back to Roman numerals using a dictionary or arrays.
Introduction to Unit Testing With NUnit in C#
The article explains unit testing in C# with NUnit, covering the AAA structure, naming conventions, test project setup, parameterized tests, setup and teardown, and metadata attributes.
Por que não uso MediatR para CQRS
Cezary Piatek argumenta que MediatR é uma boa implementação do padrão mediator — mas o mediator pattern resolve um problema diferente do CQRS. Usar MediatR para CQRS introduz fricção desnecessária em…
Read and Write Excel Spreadsheets With C#
The post shows how ExcelMapper lets .NET developers read Excel rows into POCOs or records, edit the data, and save it back to a spreadsheet with a few lines of C# 9.
What I Learned About C# From Job Interviews
The post explains which C# features help in coding interviews, from multidimensional arrays and tuples to bitwise operators, string and array helpers, plus practical interview habits.
Loop Optimizations in C# (and various other compilers)
The post shows how C# loop optimizations depend on exact code patterns, with loop cloning, hoisting, Span<T> handling, and cases where try-catch or compound assignment block them.
.NET 5 Source Generators Jump Start
The post walks through setting up a .NET 5 solution with a separate netstandard2.0 generator library, adding Roslyn packages, writing a simple ISourceGenerator, and consuming the generated code from a console app.
