C#

C

C#

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

Join

Caching?

I have been meaning to ask a question about caching. How do you determine what data to cache and when?

Trying to scaffold a MySQL database with Rider

I am trying to scaffold a MySQL database. I am using Rider. I found this article on the MySQL website: https://dev.mysql.com/doc/connector-net/en/connector-net-entityframework-core-scaffold-example.html but the commands it uses seems to require Visual Studio which i am not using. ...

I just finish my Project, How can export my project ?

I just finish my Project, How can export my project ?

Worse performance with pointers?

I don't understand how the unsafe method performs slower than the safe version. Below is the custom struct and benchmarks. ```cs [StructLayout(LayoutKind.Explicit, Size = 16)] public readonly partial struct MyCustomStruct...
No description

Conveyor belts - having a weird problem

Hey, I made conveyor belts: https://pastebin.com/s277PD0f If I place the belt facing right and then next one to the right of it facing down they connect correctly. (look at the first image) InputDirection, OutputDirection and Direction are set correctly. But then MoveItems is called (it is called every frame) they break. (second image) Left belt then has InputDirection: Right OutputDirection: Right Direction: WE and right belt has InputDirection: Left OutputDirection: Left Direction: NS which is totally wrong. Any ideas what I did wrong here?...
No description

how to download release ?

how to add the configuration 'release' to vsc
No description

✅ Background jobs, choosing the right library

Hello, I need to implement a scheduled job that will be periodically executed. Why are there so many libraries: Hangfire, Quartz, Coravel? Even .NET offeres the BackgroundService out of the box. ...

✅ How to send notification with WPF???!?!?

also I want to send the notification via a web interface

C# .NET 8.0, extract readonly struct System.Int32 from an irl GitHub

im trying to automate a search and update of a class through a github directory link, I'm having problems with the console not providing me with the logs and the class offsets not updating, and difficulties writing the script that is attached to this post, and so I have the class 'Offsets' where the value that must be updated is and 'newOffsets' where the script to update the offsets is, it seems that I am not being clear enough with my problem
No description

Need Help with Rate Limiting in Azure Function App (C#, Version 4, In-Process)

Hello everyone! Is anyone here experienced with Azure Function Apps, particularly C# developers? I have a question about applying rate limiting for the same request. Specifically, I need to limit the number of OTP generation attempts for a single email address within a specific time frame. The email address is passed in the request body. Just a note, the Azure Function App is running on version 4 with In-Process (not isolated). Any guidance would be appreciated.

Is there any better way to make a horizontally scrollable list with resizable elements than mine?

I'm currently working on a open source version of the windows 8 start screen, I managed to create a way to have a resizable tile system that scrolls horziontally, but I feel like its made in a very janky way, and I wonder how could I improve it? I've added my way of handling in the file, if more context is needed, full repo is at github.com/warenwakolj/OpenStartScreen...

Add an object to list

Hello, I am currently working on a school project. I currently have a Models folder, BLL in which there is Interfaces and Repositories. Now I'm trying to create a blog post. However, the list that keeps all the blog posts is in PostRepo. How would I do it so that every time a blogpost or any other inherited class from post will save its "post" in that list? I attached pictures for reference....
No description

✅ Per request timeout

Is there any way to control the timeout period of a HttpClient on the request side instead of from the client itself? It feels a little bizarre that a class that's recommended to only be instantiated once and shared across the app controls timeouts from the client

Server sent event & React freezing the application

In my React project, I'm using SSE to receive 10 objects per second from the server, and I'm storing these objects in the Redux store. When the data size reaches 8000+ objects, the page freezes. However, when I fetch the same data using an HTTP GET request, I can handle up to 50000 objects without any issues, and the page doesn't freeze. What could be causing the page to freeze when using SSE How can I resolve this?...

asp.net core how to add role to identity

How do we add roles to an existing identity management project?

udemy course advice related to C# , .net

i am looking for a very detailed course including .net , C# . i have currently done in a project .net , so i am not a zero level in asp.net but i want to improve myself. already thnx for helpful!

kinect for windows (version 1/ x 360) help setting up

Hello, I'm currently trying to create a project using kinect for windows (I know that it's dicsontinued, but I find it interesting). However, just trying to follow a basic tutorial I ran into this, and I don't know how to fix it. When searching it up online, I don't understand what I'm supposed to do to resolve it. I'm using Visual Studio 2022, and I made a .NETQ 6.0 WPF project...
No description

JSON Parsing to TreeView

Hello. I'm still banging my head on my desk the past 2 days trying to read a .json file which has a "table" root, into a TreeView. You'd think it would be easy for a dumbass but nope. Please help 😦 I tried ChatGPT, I tried Google, MS Learn, etc and I am a loser somehow. The example CharacterMapping.json file:...

Unable to get tabs to show after initial login screen for MAUI app

Anyone have any experience with .NET MAUI tabbed pages? I can not for the life of me get a TabBar to appear correctly after having a login cycle happen. It loads the content for the page, but the TabBar is messed up. If I comment out the ShellContent for the login page, then the TabBar shows up, but it won't load the login. ```xml <ShellContent Title="MainPage" ContentTemplate="{DataTemplate pages:MainPage}"...
No description

Non-Nullable type "required" double up.

Hi Guys, I'm creating a model for use with Entity Framework, VSCode is yelling at me because a property doesn't have "required", but I do have it in the square brackets above. Do these two different versions of "required" overlap? or do they genuinely serve different purposes?
Problem VS Code is having