C
C#3mo ago
Davo

ASP.NET Data Error

Unable to fix this error
No description
30 Replies
Pobiega
Pobiega3mo ago
$code
MODiX
MODiX3mo 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
Pobiega3mo ago
$details
MODiX
MODiX3mo 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
DavoOP3mo ago
No description
Davo
DavoOP3mo 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
Pobiega3mo ago
can you show the model, and your endpoint that receives the POST?
Davo
DavoOP3mo ago
No description
Davo
DavoOP3mo ago
No description
Pobiega
Pobiega3mo ago
Hm
Davo
DavoOP3mo ago
No description
Pobiega
Pobiega3mo 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
DavoOP3mo ago
oh okay. I'm just super new to this
Pobiega
Pobiega3mo ago
You have a ton of error handling already, what happens if you have the debugger on when you press submit?
Davo
DavoOP3mo ago
That's all ChatGPT oops
Pobiega
Pobiega3mo ago
:/
Davo
DavoOP3mo ago
:andyCry: Any idea how can I make it work?
Pobiega
Pobiega3mo ago
My question remains, have you tried debugging?
Davo
DavoOP3mo ago
I'm not sure how to do that :OhNo:
Pobiega
Pobiega3mo ago
Time to learn $debug
MODiX
MODiX3mo 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
DavoOP3mo ago
I just tried to but its so confusinggg
Pobiega
Pobiega3mo ago
Got a headset? Could jump to a VC channel and screenshare
Davo
DavoOP3mo ago
Sure that be so great
Pobiega
Pobiega3mo ago
#vc-1
Davo
DavoOP3mo 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
Pobiega3mo ago
Great!
Davo
DavoOP3mo ago
Hey there!
Davo
DavoOP3mo 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
DavoOP3mo ago
Anyways I found it My string was having different name :sadge:
Want results from more Discord servers?
Add your server