C# (C Sharp) programming
По всем вопросам- @notxxx1 Реестр РКН: https://clck.ru/3Fk3kb #VRHSZ
Show more📈 Analytical overview of Telegram channel C# (C Sharp) programming
Channel C# (C Sharp) programming (@csharp_ci) in the Russian language segment is an active participant. Currently, the community unites 18 307 subscribers, ranking 7 338 in the Technologies & Applications category and 36 903 in the Russia region.
📊 Audience metrics and dynamics
Since its creation on невідомо, the project has demonstrated rapid growth, gathering an audience of 18 307 subscribers.
According to the latest data from 12 June, 2026, the channel demonstrates stable activity. Although there has been a change in the number of participants by -16 over the last 30 days and by 5 over the last 24 hours, overall reach remains high.
- Verification status: Not verified
- Engagement rate (ER): The average audience engagement rate is 18.53%. Within the first 24 hours after publication, content typically collects 7.49% reactions from the total number of subscribers.
- Post reach: On average, each post receives 3 393 views. Within the first day, a publication typically gains 1 371 views.
- Reactions and interaction: The audience actively supports content: the average number of reactions per post is 0.
- Thematic interests: Content is focused on key topics such as .net, api, логика, архитектура, string.
📝 Description and content policy
The author describes the resource as a platform for expressing subjective opinions:
“По всем вопросам- @notxxx1
Реестр РКН: https://clck.ru/3Fk3kb
#VRHSZ”
Thanks to the high frequency of updates (latest data received on 13 June, 2026), the channel maintains relevance and a high level of publication reach. Analytics show that the audience actively interacts with content, making it an important point of influence in the Technologies & Applications category.
IMemoryCache и IDistributedCache.
🔧 Что даёт HybridCache:
• Единый API для in-memory и distributed кэша
• Настраиваемая сериализация
• Stampede protection (анти-нагрузочная защита)
• Удаление по тегам
🧠 Как работает GetOrCreateAsync:
1. Проверяет локальный и распределённый кэш
2. Если нет — вызывает фабричный метод
3. Кэширует результат и возвращает его
🛡️ Stampede protection: только один запрос на ключ запускает фабрику, остальные ждут — никакой гонки или перегрузки БД.
📌 Сниппет на .NET 9 выглядит так:
app.MapGet("/products/{id}", async (
int id,
HybridCache cache,
ProductDbContext db,
CancellationToken ct) =>
{
var product = await cache.GetOrCreateAsync(
$"product-{id}",
async token =>
{
return await db.Products
.Include(p => p.Category)
.FirstOrDefaultAsync(p => p.Id == id, token);
},
cancellationToken: ct
);
return product is null ? Results.NotFound() : Results.Ok(product);
});
HybridCache доступен для ASP.NET Core
Все разработчики могут воспользоваться HybridCache для более эффективного управления кэшем в приложениях на ASP.NET Core.
var result = await AC<LegacyUserDTO, NewUserModel>(legacyUser);
— преобразует старую DTO-модель в новую без ручной работы
var request = new MathRequest { Tokens = new() { "(", "2", "+", "3", ")", "*", "4", "-", "6", "/", "3" } };
var response = await AC<MathRequest, MathResponse>(request);
— рассчитывает результат выражения и генерирует пошаговое решение
⚠️ Проект предназначен только для демонстрации — в продакшн пока не стоит запускать, но как proof-of-concept это отличная иллюстрация, как LLM могут расширять возможности .NET-разработки.
🔗 Репозиторийstruct с интерфейсами. Поведение кажется очевидным — но только на первый взгляд.
📦 Задача
using System;
public interface ICounter
{
void Increment();
int Value { get; }
}
public struct Counter : ICounter
{
private int _value;
public void Increment()
{
_value++;
}
public int Value => _value;
}
class Program
{
static void Main()
{
ICounter counter = new Counter();
counter.Increment();
counter.Increment();
Console.WriteLine(counter.Value);
}
}
❓ Что выведет код?
A) 0
😎 1
C) 2
D) Ошибка компиляции
💡 Разбор
Наивный ответ — 2, ведь Increment() вызывается дважды. Но!
📦 Counter — это struct, то есть value type.
Когда мы присваиваем Counter переменной типа ICounter, происходит boxing — создаётся копия структуры в heap.
🔁 Каждый вызов counter.Increment() работает с новой копией, потому что интерфейс не может напрямую изменить struct без создания временного объекта.
🧱 В итоге Increment() изменяет внутреннее состояние временной копии, но не оригинального значения.
✅ Ответ: 0
🧨 Подвох
Использование struct через интерфейс приводит к boxing.
Вызываемые методы действуют на копии, а не на оригинале.
Изменения теряются, и это не ошибка компиляции — это логическая ловушка.
🔧 Как исправить?
Вариант 1: Сделать Counter классом:
```csharp
public class Counter : ICounter
{
private int _value;
public void Increment() => _value++;
public int Value => _value;
}
public class Counter : ICounter
{
private int _value;
public void Increment() => _value++;
public int Value => _value;
}```
@csharp_ci
Available now! Telegram Research 2025 — the year's key insights 
