C
C#2mo ago
Davo

ASP.NET Data Error

Unable to fix this error
No description
30 Replies
Pobiega
Pobiega2mo ago
$code
MODiX
MODiX2mo ago
To post C# code type the following: ```cs // code here ``` Get an example by typing $codegif in chat For longer snippets, use: https://paste.mod.gg/
Pobiega
Pobiega2mo ago
$details
MODiX
MODiX2mo ago
When you ask a question, make sure you include as much detail as possible. Such as code, the issue you are facing, what you expect the result to be, what .NET version you are using and what platform/environment (if any) are relevant to your question. Upload code here https://paste.mod.gg/, save, and copy the link into chat for others to see your shared code! (see $code for more information on how to paste your code)
Davo
Davo2mo ago
No description
Davo
Davo2mo ago
So basically its a Flight Booking System and I'm trying to book a flight here with number of Seats to reserve but its always ending up me in the error
Pobiega
Pobiega2mo ago
can you show the model, and your endpoint that receives the POST?
Davo
Davo2mo ago
No description
Davo
Davo2mo ago
No description
Pobiega
Pobiega2mo ago
Hm
Davo
Davo2mo ago
No description
Pobiega
Pobiega2mo ago
Oh no, your viewmodel is a database entity?! This is a huge no-no Its probably not the reason for your current issues, but I'd still recommend not doing that
Davo
Davo2mo ago
oh okay. I'm just super new to this
Pobiega
Pobiega2mo ago
You have a ton of error handling already, what happens if you have the debugger on when you press submit?
Davo
Davo2mo ago
That's all ChatGPT oops
Pobiega
Pobiega2mo ago
:/
Davo
Davo2mo ago
:andyCry: Any idea how can I make it work?
Pobiega
Pobiega2mo ago
My question remains, have you tried debugging?
Davo
Davo2mo ago
I'm not sure how to do that :OhNo:
Pobiega
Pobiega2mo ago
Time to learn $debug
MODiX
MODiX2mo ago
Tutorial: Debug C# code and inspect data - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger, step through code, and inspect data in a C# application.
Davo
Davo2mo ago
I just tried to but its so confusinggg
Pobiega
Pobiega2mo ago
Got a headset? Could jump to a VC channel and screenshare
Davo
Davo2mo ago
Sure that be so great
Pobiega
Pobiega2mo ago
#vc-1
Davo
Davo2mo ago
@Pobiega Thanks for the help! Great to know about the debug part I simplify it by using a simple int its working now. I can later on get more details from the user session that would be fine !
Pobiega
Pobiega2mo ago
Great!
Davo
Davo2mo ago
Hey there!
Davo
Davo2mo ago
Can anyone tell me how can I save that session information because when I tried it saves the String Part Username but the Id changes itself
No description
Davo
Davo2mo ago
Anyways I found it My string was having different name :sadge:
Want results from more Discord servers?
Add your server