C#

C

C#

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

Join

Did I implement State Machine Pattern correctly?

Im trying to implement State Machine Pattern for the state of a form, but I feel like it's not right or adding any convenience. Context: User fills in a form on my webpage. User then saves the form. Upon saving, the form should get one of the following states:...

Y it doubles on adding?

I have a code like this
c#
a += b;
c#
a += b;
I have overloaded operator +. T is class with list & a lot's of readonly fields depending on this list. b is always small, something like ~0.001 and on adding elements become 2 limes larger. When i debug it, it works normal. Here is code of operator:...

✅ SkiaSharp apply gradient on the whole canvas except to one color

Hello, I would like to apply a gradient texture on a canvas, after the drawing is complete, and not to draw individual shapes with gradient color, that would have a different effect. Is there a way to apply gradient to the whole canvas except to a certain color? In my case I would like the canvas background to remain white, but the black areas to have a gradient effect...
No description

✅ always gets the invalid data received

I have been creating a simple CRUD app with the ASP.NET. My update function does not work as expected: the save button triggers the error message "invalid data received" ; somehow the model reference is considred null on clicking the save button ``` //clicking the save btn prompts this method to work public async Task<IActionResult> Update(ListingProjects updatedUserModelRef)...

Search object Inner list for value

My googlefu is failing for this one. I have a list of an outer class (Board) that contains a (inner) list of another class (Properties). Properties is essentially a dictionary (the object gets saved to XML, and you can't serialise a dictionary) with two properties, Property and Value, which are used to store various properties of the parent/outer class. ...

How to add a recource file from a .net forms project into a setup file.

Basically im doing a school project and i have written a whole project using recourses within my Resource file in my forms app. however when i go to compile it into a setup file none of my file have directorys and i cant find them in the compiled app, even though when I run a Debug compile on visual studio it all works. Please help im behind on a deadline

Looking for a mentor

Hello everyone! I'm an ASP.NET Core developer with 2 years of experience, currently working on a mini social network project. Right now, I'm focusing solely on the back end. My goal is to build separate APIs and databases for each feature (e.g., Publication.API, User.API, Auth.API) and connect them through an API Gateway....

radar graph

how should i do a graph like this:
No description

✅ Chances to get unpaid internship as a beginner

I’ve been learning C# for about three months and would love to gain real-world experience in a company or startup. Do you think it will be hard to find an unpaid internship during the summer holidays? P.S. I’m 18 years old, based in Germany, and I don’t have a computer science degree. My primary focus is on backend development with ASP.NET....

Custom Controls won't show in XAML Designer when referenced via .dll

Dear C#-Community, Currently, I was implementing custom WPF controls. These custom controls have their own style, which are referenced in the Themes/Generic.xml file. However, when I build the .dll file of the custom control library and reference it in a new project, the designer won't show the custom controls, but they are definitely there. I would see them, if I start the project. ...

large matrix multiplication

What is the fastest way to do matrix multiplication in c#, still Intel MKL, or would you suggest ILGPU or managedCuda

Can someone help me fix my code, it doesnt open usercoontrols form porperly

i just satrted to learn c# and if i dont understand something sorry

✅ Good courses for ASP.NET backend

Hi. I want to become a backend developer using ASP.NET, and Web API in particular. I already have a bit of experience with this framework, but my knowledge is not too great. Could somebody recommend quality learning resources for this goal?

Issue with Nested One-to-Many Relationships in SQLite-Net Extensions: LevelTwoModels Property Return

I am working on a model hierarchy using SQLite and SQLite-Net Extensions. The model structure consists of three levels: RootModel, LevelOneModel, and LevelTwoModel. Each model contains properties that establish relationships with the next level, as follows: RootModel has a one-to-many relationship with LevelOneModel. LevelOneModel has a one-to-many relationship with LevelTwoModel. Here is my implementation: `...

Error: dotnet restore Fails with NullReferenceException in .NET SDK 9.0.100 During Docker Build

I'm trying to publish my project updated to .net9 to GitHub packages to later run on my Raspberry Pi 5. But I'm having these issues. https://github.com/dotnet/sdk/issues/44841 Been stuck on this for the past 2 weeks, would be great if someone could check it out....

WHAT LANGUAGES OR FRAMEWORKS SHOULD I LEARN ALONGSIDE C# FOR DESKTOP, WEB, GAMES

i am new to C# but i really wanna learn it, i don't have that much of a prior knowledge to other programing languages, but i know my way around. can someone breakdown for me me what languages or framework i should learn to make desktop apps and websites with c# mainly. thank you so much

✅ Unknown words in web

Hello everyone, I encountered many unknown words when first tried to learn asp.net. What should I learn first before getting on asp.net?

CSS wont apply to the code

For some reason why i try to add a CSS style to a specific section of my ASP.NET code, it does seem to work at all? Yes, i do have the stylesheet connect and i know it is because its working on other parts of the code EXCEPT new changes i am making right now. Ive tried removing and adding back older codes where it does work and they apply just fine but for this part like shown in the image, it doesnt. I am testing this by adding a background color to the 'div' tag and making it red as well as making the color of the text red but as shown, nothing happens and they text is simply black and no background color even appears...
No description