C#

C

C#

We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.

Join

Best resources to learn Blazor?

Hi everyone! I'm looking for some good resources to learn Blazor (not the official documentation). I'd be happy to know if you guys have any good courses, blogs, articles or youtube videos to recommend.

✅ I am trying to create a price quotation application controller

I have never used .NET before. I am trying to create an application that calculates a subtotal and discount and than displays that to the user. In order to do that I need to make a controller for my app that application. That utilizes my views. I have never developed in .NET before. How do I create something for a view that I haven't even created yet!? ...

✅ speedrun.com app creating issue

https://pastebin.com/ZE2UWkgx Hi, I have issue with SpeedrunComSharp API. I can't to add all categories in combo box by searching the game, 'cause this variable is null. Anyone help me!...
No description

Dependency injection

I have 2 classes, 1 Wolt adapter and second one is Glovo adapter. Both of them need http clients to be injected but the problem is that when i run both of them Wolt's http client is not being injected but when i run onlt Wolt adapter it works. It does not even log anything. could somebody explain why?

✅ my enter and backspace keys are not working in Visual Studio

I don't know why but i just updated VS and now my bakcspace and enter keys are not working now

✅ Coordinates of Avalonia vs Scratch

Hey there: ok, so I have a window with a width of 480 and height of 360. I am using a Scratch Project and I am trying to convert it to an Avalonia Project, but the thing is I can´t find a way to make exact coordinates. I don´t know how the coordinates of avalonia work. And what is the big difference betweeen the centered coordinate system (from Scratch) (where 0|0 is in the middle) and avalonia, because I can´t find a way to "convert" it right :(. Thanks for help in advance :).

Interaction of 'first class spans' with inline array types/Extension methods over inline array types

Given several inline array types of byte of various lengths used to model certain fixed size buffers: ```cs [InlineArray(40)] public struct ByteArray40 { private byte _b;...

✅ buttone game.

I got a task is to randomize a 4x4 board with 15 visible buttons and one hidden. When a button next to the empty space is clicked, the clicked button moves (by animaton) to the empty space : We execute Timer.Start (on button click) and Timer.Stop when the button reaches its movement destination. At each Timer_Tick step, the button moves by a number of pixels and we get an animation-like movement.. The goal is to sort the buttons in ascending order, with the hidden button in the bottom-right corner. but my problam is that when i click on a button whos next to an invisible one the button tha i clicked on is going stright to the 16th place (i uploaded a vid), can somebody help me figure why ? ...
No description

✅ anyone know how to make a woofer?

just need to know how to make a woofer

✅ FusionCache RemoveByTagAsync not removing proper tags?

Hi, I am trying to get an understanding of FusionCache to use it as a hybride cache (local memory and Redis). Currently, when I try to invalidate the cache, FusionCache adds the "tag indexes" to the cache, but the actual data keys are still present as well. I am not sure if this is supposed to happen, but I doubt....
The red-circled keys should not exist after RemoveByTagAsync is called.

✅ Creating ViewModel for Maui doesn't propagate changes

I am attempting to cleanup my Maui app a bit and wanted to create an abstract class ViewModel that implements the boilerplate code for INotifyPropertyChanged. When I user ViewModel on an already functioning page, the properties are not being updated and displayed to the bound control. ViewModel...

ssh c# implementation exaplanation of some shenanigans

i have a couple of questions regarding this code, the first one being it reads 8 bytes from the socket, which contains the packet_length (4 bytes) and the padding_length (1 byte) why then is required to calculate ...

Any one know of a less repetitive way to write to an event outbox using Avro objects for Kafka?

```csharp public async Task<int> CreateResource(int resourceName, DateTime timestamp, IDbTransaction transaction) { string sql = //some create sql for some table dbo.Resource var parametrs = new {...}; int someRetVal await connection.ExecuteAsync(sql, parameters, transaction);...

✅ Generalized Storage

I am building a library that will act as a game engine for a card game. I want this to be a tool someone can use to build a game server for the game. I want to allow the developer to choose their storage method. Are there any established frameworks to allow the developer to choose how to store stuff? Half my issue is i am not really sure what the options are. I've worked with EF core for SQL stuff and there is JSON, but i am sure there are many other options like a NoSQL database so i am just kind of looking for what people do....

✅ Advanced style for subtitles

how does capcut make their subtitles with advanced style and if i wanna make it in C# which library should i use. Because i already tried one using ass file but I think ass file are not enough to make advanced style like glow or glitch effect

✅ Integration testing, database transaction

hi i'm learning about dotnet test tools, using xunit i have a web app, i want to write some integration tests for it...

✅ Selection using spectre.console

``cs using Spectre.Console; using System.Threading.Channels; void choiceMenu() {...
No description

✅ connect a subscription model

Hi, I'm looking for someone to connect a subscription model, e.g., via Paddle, to my FocusMore app—an app that boosts productivity and helps with everyday distractions. The app was created in WPF....
No description

✅ Prevent unauthorized access to WEB API folders and files within the folder.

In my .NET 6 Web API project, I have an UploadFiles folder where user-uploaded files are stored. Currently, anyone who knows the folder path or file URL can directly access the files in the browser, since static file middleware serves them without authentication or authorization. I want to restrict access so that only authenticated users (or users with a signed/secure link) can download these files. Middleware like UseAuthentication and UseAuthorization doesn’t protect static file requests by default....