So I looked around but can't seem to find quite what I'm looking for.
I want to fetch a list of all my users in the database. I know that I can create a new User object, but I want the object to be created from the database, and return in a JSON format. I'm using entityframework.
TimeFlowDbContext db = new TimeFlowDbContext();
private List<User> _users = new List<User>
{
new User {
UserId = 1,
Firstname = "Test",
Lastname = "Man",
Username = "test",
Password = "test"
}
};
I've tried a lot of different things, but I don't really understand how to list them from my database and return JSON..
Thanks in advance if anyone can link me some documentations or explain the right answer.