Programming & AI Tips 💡
45.8K subscribers
67 photos
11 videos
30 files
388 links
Programming & AI:
Tips 💡
Articles 📕
AI & LLMs 👾
Design, Architecture, Principles ✅

🇳🇱 Contact: @MoienTajik
Download Telegram
5 Rules for Writing Better and Cleaner DTOs 🧹

Crafting clean and maintainable DTOs is essential for keeping your codebase healthy and scalable. But let's face it, sometimes DTOs can morph into these complex beasts that leave you scratching your head.  ‍

Fear not, fellow developers!

This article (or the accompanying video!) dives into 5 key principles to help you write simpler, more understandable DTOs.

You'll learn about:

• Keeping things clear and concise
• Utilizing properties effectively ✨
• Crafting descriptive names that make sense

And also other tips to transform your DTOs from chaotic to crystal clear! By following these principles, you'll be well on your way to writing cleaner, more maintainable DTOs that make your code easier to understand for you and your team.

Ready to up your DTO game? Check out the full article or watch the video for examples and take your codebase to the next level!

[ Article ] : https://ardalis.com/5-rules-dtos

[ YouTube ] : https://www.youtube.com/watch?v=W4n9x_qGpT4

〰️〰️〰️〰️〰️〰️
#Dto #Dotnet #csharp #programming
@ProgrammingTip
OpenAI .NET 👾

The OpenAI .NET library provides convenient access to the OpenAI REST API from .NET applications. ✔️

The full API of this library can be found in the api.md file, and there are many code examples to help. For instance, the following snippet illustrates the basic use of the chat completions API:

ChatClient client = new(model: "gpt-4o", "OPENAI_API_KEY");

ChatCompletion completion = client.CompleteChat("Say 'this is a test.'");

Console.WriteLine($"[ASSISTANT]: {completion}");


The library is organized into several namespaces corresponding to OpenAI feature areas. Each namespace contains a corresponding client class:

• AssistantClient
• AudioClient
• BatchClient
• ChatClient
• EmbeddingClient
• FineTuningClient
• FileClient
• ImageClient
• ModelClient
• ModerationClient
• VectorStoreClient


[ GitHub ] : https://github.com/openai/openai-dotnet

〰️〰️〰️〰️〰️〰️
#AI #OpenAI #DotNet #CSharp
@ProgrammingTip
Please open Telegram to view this post
VIEW IN TELEGRAM
NetPad 🔥

A cross-platform C# editor and playground.

NetPad is a C# playground that lets you run C# code instantly, without the hassle of creating and managing projects. Open NetPad, start coding, hit Run, and see your output immediately. It's that simple. ✔️

• Prototyping and Testing:
Quickly prototype and test code snippets before incorporating them into your projects.

• Data Visualization: Visualize data interactively for better insights and analysis.

• Database Queries: Query databases using LINQ or SQL effortlessly.

• Learn and Experiment: Experiment with new C# features or start learning C# in an intuitive and accessible environment.

• Utility Scripts: Create and save your own utility or administration scripts for repeated use.


[ GitHub ] : https://github.com/tareqimbasher/NetPad

〰️〰️〰️〰️〰️〰️
#NetPad #Linqpad #CSharp #DotNet
@ProgrammingTip
Please open Telegram to view this post
VIEW IN TELEGRAM
I Built a .NET App Using AI (with Cursor) - This Is Amazing ✅

Discover how Cursor AI can transform your .NET development workflow! 🚀

In this video, you will see how this AI-powered code editor can help you write better code faster, understand complex codebases, and automate repetitive tasks. Whether you're a seasoned developer or just getting started with .NET, Cursor's AI capabilities will change how you think about coding.


[ YouTube ] : https://youtu.be/5hyRBuW560c

〰️〰️〰️〰️〰️〰️
#AI #Cursor #DotNET #CSharp
@ProgrammingTip
Please open Telegram to view this post
VIEW IN TELEGRAM
Build a Model Context Protocol (MCP) Server in C# 🧠

Learn how to create an MCP server using .NET 8 and ASP.NET Core! ⚡️

This guide walks you through building a server that can interact with AI models via the Model Context Protocol — a standard for managing model prompts, memory, and tools. Great for AI agent developers! 🤖🧠


[ Blog ] : https://devblogs.microsoft.com/dotnet/build-a-model-context-protocol-mcp-server-in-csharp

〰️〰️〰️〰️〰️〰️
#AI #MCP #dotnet #csharp
@ProgrammingTip
Please open Telegram to view this post
VIEW IN TELEGRAM
C# 14 - Extension Members 🚀

C# 14 adds new syntax to define extension members. The new syntax enables you to declare extension properties in addition to extension methods. ✔️

You can also declare extension members that extend the type, rather than an instance of the type. In other words, these new extension members can appear as static members of the type you extend.

The following code example shows an example of the different kinds of extension members you can declare:
public static class Enumerable
{
// Extension block
extension<TSource>(IEnumerable<TSource> source) // extension members for IEnumerable<TSource>
{
// Extension property:
public bool IsEmpty => !source.Any();
// Extension indexer:
public TSource this[int index] => source.Skip(index).First();

// Extension method:
public IEnumerable<TSource> Where(Func<TSource, bool> predicate) { ... }
}

// extension block, with a receiver type only
extension<TSource>(IEnumerable<TSource>) // static extension members for IEnumerable<Source>
{
// static extension method:
public static IEnumerable<TSource> Combine(IEnumerable<TSource> first, IEnumerable<TSource> second) { ... }

// static extension property:
public static IEnumerable<TSource> Identity => yield return default;
}
}


The members in the first extension block are called as though they're instance members of IEnumerable<TSource>, for example sequence.IsEmpty. The members in the second extension block are called as though they're static members of IEnumerable<TSource>, for example IEnumerable<int>.Identity.


[ Blog ] : https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/extension-methods

〰️〰️〰️〰️〰️〰️
#csharp #dotnet
@ProgrammingTip
Please open Telegram to view this post
VIEW IN TELEGRAM
The Hidden Cost of DateTime.Now in .NET 🕰

You're Using DateTime.Now — and It's Breaking Your Code … ❌

Let's be honest: We've all written this:
if (DateTime.Now > token.Expiry)
{
return Unauthorized();
}


It works… until it doesn't.

In production, this little line can wreck your logic due to clock drift, time zone shifts, or mocking nightmares. 🐞


[ Article ]
: https://freedium.cfd/https://medium.com/@yaseer.arafat/the-hidden-cost-of-datetime-now-and-what-every-net-developer-should-use-instead-8859863257a1

〰️〰️〰️〰️〰️〰️
#dotnet #csharp
@ProgrammingTip
Please open Telegram to view this post
VIEW IN TELEGRAM
🚀 .NET 10 is here! 🔥

The successor to .NET 9 is now out — and it’s a Long-Term Support (LTS) release, supported for the next 3 years.

👉 [ Learn what’s new ] :
https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-10/overview

〰️〰️〰️〰️〰️〰️
#dotnet #csharp #aspnetcore #maui
@ProgrammingTip
.NET 11 performance work is landing across the stack 🔥

Microsoft published the running list of performance improvements headed for .NET 11. This is not one magic runtime switch. The work spans the runtime, JIT, libraries, and tooling paths that show up in normal application code.

Use the post as a migration checklist:

• Find code that is CPU-bound, allocation-heavy, or called per request.
• Run your benchmarks on the .NET 11 SDK, not a synthetic microbenchmark only.
• Check p50 and p99 latency, allocations, startup, and throughput separately.

The best upgrade wins are boring: existing C# gets faster with fewer code changes. But measure your service. A JIT win can disappear behind JSON, EF queries, network calls, or a container CPU limit.

[ Blog ] :
https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-11/

〰〰〰〰〰〰
#dotnet #csharp #Performance #dotnet11
@ProgrammingTip
GitHub improved the Copilot code review flow 🔥

GitHub shipped an improved Copilot code review experience. That matters most on the boring, high-volume PRs where reviewers need help finding a real issue, not another summary of changed files.

For C# teams, use Copilot review as an extra pass on every ASP.NET, EF Core, and library PR. Then keep the human review focused on contracts, failure behavior, and whether the change belongs in the codebase.

Practical rule:

• Let Copilot flag suspicious diffs.
• Do not merge because it found nothing.
• Keep analyzers and tests as the enforcement layer.

AI review is cheap coverage. It is not a replacement for someone who knows why that nullable property or cancellation token exists.

[ Read More ] :
https://github.blog/changelog/2026-09-18-copilot-code-review-an-improved-review-experience

〰〰〰〰〰〰
#dotnet #csharp #GitHub #Copilot
@ProgrammingTip
NuGet packages can deliver agent skills 🔥

Microsoft is showing how to ship skills in NuGet packages.

The idea is simple: a package can carry more than assemblies, analyzers, and build targets. It can also deliver instructions and reusable capability definitions that coding agents can discover in a repo.

Why this is useful:

• Package authors can document the right workflow next to the API.
• App teams get consistent agent guidance when they install a dependency.
• Platform teams can distribute internal conventions without pasting the same prompt into every project.

Treat these skills like any other package surface. Version them, keep the instructions narrow, and test them against real agent tasks before publishing.

[ Blog ] :
https://devblogs.microsoft.com/dotnet/delivering-skills-in-nuget-packages/

〰〰〰〰〰〰
#dotnet #NuGet #CSharp #AI
@ProgrammingTip
.NET 11 is out 🔥

.NET 11 has landed. The first practical move is not changing every project file. Get the SDK into CI, build a representative solution, and make the failures visible.

Start with:

• Install the .NET 11 SDK in a non-production pipeline.
• Test net11.0 alongside your current target framework.
• Review package compatibility, analyzers, source generators, and native dependencies.
• Pin the SDK with global.json before developers get different local results.

A major runtime release is a good excuse to delete old workarounds too. Run benchmarks before and after, especially around hot APIs, JSON, HTTP, and startup. "It builds" is only the first green check.

[ Blog ] :
https://devblogs.microsoft.com/dotnet/announcing-dotnet-11/

〰〰〰〰〰〰
#dotnet #csharp #dotnet11
@ProgrammingTip