morry329#
morry329#
CC#
Created by morry329# on 11/8/2024 in #help
Save button does not save the inserted data
I just got rid of all the IEnumerable implementation, then the exception is gone. ChatGPT recommended me to make the ListingProjects enumerable (as I wanted to make a collection of vacation listing names) But now for the sake of simplicity I will learn more about IEnumerable, this one caused me some unwanted exception
15 replies
CC#
Created by morry329# on 11/8/2024 in #help
Save button does not save the inserted data
ups, I did not want to return all the records from the table .. see, I did not understand what my code is doing. so with this line return await _context.ListingDBTable.ToListAsync(); it will return all records from the table, correct? And it eventually triggers the exception as it causes the circulation or
15 replies
CC#
Created by morry329# on 11/8/2024 in #help
Save button does not save the inserted data
Network tab just got me this https://pastebin.com/stiTYN5g This exception seems to point to
[HttpGet("availableListings")]
public async Task<IEnumerable<ListingProjects>> Get()
{
return await _context.ListingDBTable.ToListAsync();
}
[HttpGet("availableListings")]
public async Task<IEnumerable<ListingProjects>> Get()
{
return await _context.ListingDBTable.ToListAsync();
}
` This method is in the API controller class separately created from HomeController (where this save method lies) : you can find the full code for the API controller https://pastebin.com/f73x8fDN I tried something like this on Program.cs
builder.Services.AddControllersWithViews().AddJsonOptions(options =>
{
options.JsonSerializerOptions.ReferenceHandler = ReferenceHandler.Preserve;
options.JsonSerializerOptions.PropertyNameCaseInsensitive = true;
});
builder.Services.AddControllersWithViews().AddJsonOptions(options =>
{
options.JsonSerializerOptions.ReferenceHandler = ReferenceHandler.Preserve;
options.JsonSerializerOptions.PropertyNameCaseInsensitive = true;
});
` But the exception is not gone I suppose this exception prevents my code from what it should be doing
15 replies
CC#
Created by morry329# on 11/3/2024 in #help
Does this make sense? |
Ok so it does not make sense then. I do not ask for the solution code or anything but I would like some advice on how to approach it: I googled how to delete the card view with the button Onclick: I only found the frontend ways like manipulating jquery to make the div items disappear (that div has no text data retrieved/loaded from SQL). If the div card item displays data loaded from SQL, does it still make sense to remove it via jquery etc? Or would you do that very differently?
5 replies
CC#
Created by morry329# on 10/7/2024 in #help
Not found 404 at await fetch
No description
6 replies
CC#
Created by morry329# on 10/7/2024 in #help
Not found 404 at await fetch
Hi! So I tried like this await fetch('/api/APIController/availableListing') Unfortunately the 404 error stays as per screenshot attached What could cause this? Maybe the API controller did trigger this 404?
6 replies
CC#
Created by morry329# on 9/30/2024 in #help
Does it make sense to two references (to database migration and data seeding) in the same using
Thank you so much for the detailed explanation 🙏 I will remove the services line then
6 replies
CC#
Created by morry329# on 9/24/2024 in #help
created a new view but that view only outputs the html (of the login page!)
well this innovative idea came from AI, ofc not from me. No idea what kind of company needs an app like this, returning HTML instead of JSON :kekw: I ended up adding this line return Redirect(requestUrl) I hope this is what you meant
23 replies
CC#
Created by morry329# on 9/24/2024 in #help
created a new view but that view only outputs the html (of the login page!)
Ahh ok ContentType = "application/json", So my uneducated guess is: if I keep application/json like this the app will display the bunch of HTML on the browser, right? I assume changing this would do the trick
23 replies
CC#
Created by morry329# on 9/24/2024 in #help
created a new view but that view only outputs the html (of the login page!)
Please bear with me asking this stupid question: what is the mime type you are referring to?
23 replies
CC#
Created by morry329# on 9/24/2024 in #help
created a new view but that view only outputs the html (of the login page!)
it's just everything was so new to me that I have no idea where I was fetching the HTML from
23 replies
CC#
Created by morry329# on 9/24/2024 in #help
created a new view but that view only outputs the html (of the login page!)
I see, thank you so much for helping me understand this code. I am very new to this. Could you give me some hint to await that properly (or do you have some links)?
23 replies
CC#
Created by morry329# on 9/17/2024 in #help
MySqlException: Field 'CreatedOnUtc' doesn't have a default value
👍
4 replies
CC#
Created by morry329# on 9/14/2024 in #help
MySqlException: Table 'searchhome.aspnetusers' doesn't exist
Thank you so much for the guideline -- just a quick question. Since I am on Rider, it doesn't seem to have the Package Manager Console (it's only for Visual Studio, right?) In that case I can use "dotnet ef database update " after I added the initial migration, right?
16 replies
CC#
Created by morry329# on 7/10/2024 in #help
Dealing with the professor: advice appreciated
Sure I will but I found out that yelling/screaming sometimes helps me get out of the stressful situation like this oral exam. Because of our shared "great" histories respect is lost between this prof and myself. I have already done something against him which I am sure compromised his academic career. So I somehow understand why he behaves like this with me. I never got good grades from him since then (so his classes are my GPA killers). But I am fine with this
13 replies
CC#
Created by morry329# on 7/10/2024 in #help
Dealing with the professor: advice appreciated
It could be. If they want to suspend me for misconduct they have to produce some written evidence plus witnesses' notes - collecting supporting documents take them time. I doubt they would dare to do so
13 replies
CC#
Created by morry329# on 7/10/2024 in #help
Dealing with the professor: advice appreciated
Yup, I just need to carry on I already confronted him today. Next time I would not hesitate to scream/yell at him if I need to, see what happens next
13 replies
CC#
Created by morry329# on 7/10/2024 in #help
Dealing with the professor: advice appreciated
I will tell all this once again to the profs next week (see if my talking to myself wins or if his interruption/repeated questions win). But it has been stressful to see him on the exam. I feel like I'd have two different court procedure which sack up my mental energy
13 replies
CC#
Created by morry329# on 7/10/2024 in #help
Dealing with the professor: advice appreciated
Yeah I know it's not really C# related but I just wanted to vent out my stress on the Internet Sure I will see if my grades will be impacted by it but my observation is that he intentionally avoids understanding me or repeating the questions/pretending that he would not understand me I am pretty sure he behaves like this with other students as well. So much so we take his name as an example of "the lead patient" just to dishonour him this way. One such student told me his presence scares her whenever she is in class etc I am also pretty sure he tries to fail me in any way he could (yes we have some "great" shared histories in the last few semester)
13 replies
CC#
Created by morry329# on 6/14/2024 in #help
KMP-Algorithm in C#
If you don't mind me asking again - I still have a trouble understanding why the KMP algorithm needs to fall back to when there's not a match. Is it actually what this algorithm should do or is it a function to prevent exceptions/overflow like out-of-range exception?
10 replies