morry329#
Unable to create an object of type 'JsonContext'
So I removed parameterless JsonContext() with Database.EnsureCreated(). Those were replaced with
but the error persists (
Unable to create an object of type 'JsonContext'. For the different patterns supported at design time, see `https://go.microsoft.com/fwlink/?linkid=851728)
No idea what triggerd this error. Do you have any idea?8 replies
Edit function does not work
Not at all
In my IDE the ListingProject has properties as follows
it is strange for me that my app thinks my listingProject class looks like that
public class ListingProject
{
public int Id { get; set; }
public string ListingName { get; set; }
public string __RequestVerificationToken { get; set; }
}`
I have no idea why. Do you have idea?20 replies
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
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
Save button does not save the inserted data
Network tab just got me this https://pastebin.com/stiTYN5g
This exception seems to point to
`
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
`
But the exception is not gone
I suppose this exception prevents my code from what it should be doing
15 replies
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
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 meant23 replies
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