❔ Trying to run operations off of a MVC API

Everything is loading properly, however this solution is very primitive because it uses a list instead of a context for now (MVP). I would like to do a simple Get, that returns everything in this list, and it will be attached as a screenshot at the end of this message. The only problem (and it is a big one), is that every time I try to run this (IIS), it thinks for about 5 seconds, and then crashes without throwing any error. What should I do?
28 Replies
𝕞𝕚𝕝𝕜
𝕞𝕚𝕝𝕜OP3y ago
Angius
Angius3y ago
Yeah, .ToString()ing a list does not work like you think it would Just return Ok(theList)
𝕞𝕚𝕝𝕜
𝕞𝕚𝕝𝕜OP3y ago
I tried that, also didnt work @ZZZZZZZZZZZZZZZZZZZZZZZZZ
Angius
Angius3y ago
And, of course, the return type should not be a string
𝕞𝕚𝕝𝕜
𝕞𝕚𝕝𝕜OP3y ago
Ill double check it though Right, List<Store> should do ti. it. Still nothing @ZZZZZZZZZZZZZZZZZZZZZZZZZ
Angius
Angius3y ago
What's your updated code? Maybe it's something with IIS, dunno. I've never used IIS in my life
𝕞𝕚𝕝𝕜
𝕞𝕚𝕝𝕜OP3y ago
[HttpGet("Get")]
public ActionResult<List<Store>> Get()
{
if (stores.Count != 0 && stores != null)
{
return Ok(stores);
}
return BadRequest("There are no stores currently in the database!");
}
[HttpGet("Get")]
public ActionResult<List<Store>> Get()
{
if (stores.Count != 0 && stores != null)
{
return Ok(stores);
}
return BadRequest("There are no stores currently in the database!");
}
neither have I 😭
Angius
Angius3y ago
Do you have to use IIS?
𝕞𝕚𝕝𝕜
𝕞𝕚𝕝𝕜OP3y ago
well its a local project, and using Http/https wont work because the certificate is bunz. so im guessing so
Angius
Angius3y ago
Kestrel is a thing
𝕞𝕚𝕝𝕜
𝕞𝕚𝕝𝕜OP3y ago
with VS?
Angius
Angius3y ago
The IDE has nothing to do with anything
𝕞𝕚𝕝𝕜
𝕞𝕚𝕝𝕜OP3y ago
I run it off of the IDE though
𝕞𝕚𝕝𝕜
𝕞𝕚𝕝𝕜OP3y ago
Angius
Angius3y ago
Uh, maybe you can change the run setup? Dunno, been years since I used VS Also, did you try debugging? Placing a breakpoint here and there
𝕞𝕚𝕝𝕜
𝕞𝕚𝕝𝕜OP3y ago
i did, nothing worked. it didn't even hit the breakpoints (yes I was in debug mode)
Angius
Angius3y ago
In that case, no idea Everything about this endpoint seems perfectly fine
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
𝕞𝕚𝕝𝕜
𝕞𝕚𝕝𝕜OP3y ago
Same thing happens.
𝕞𝕚𝕝𝕜
𝕞𝕚𝕝𝕜OP3y ago
𝕞𝕚𝕝𝕜
𝕞𝕚𝕝𝕜OP3y ago
But I found this error.
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
𝕞𝕚𝕝𝕜
𝕞𝕚𝕝𝕜OP3y ago
Like I dont know thats why I asked I dont have any idea to what that is telling me but I didn't know if it would help
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Accord
Accord3y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
𝕞𝕚𝕝𝕜
𝕞𝕚𝕝𝕜OP3y ago
still did not work.
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Accord
Accord3y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Did you find this page helpful?