Hello,
I'm learning the Entity framework core and encountered in this tutorial:
You can see the page here:
https://entityframeworkcore.com/querying-data-basic-query
And in there comes:
Let's say we have a simple model which contains three entities.
public class Customer
{
public int CustomerId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string Address { get; set; }
public virtual List<Invoice> Invoices { get; set; }
}Load All data
The following example loads all the data from Customers table.
using (var context = new MyContext())
{
var customers = context.Customers.ToList();
}This code isn't working. Is this wrong or outdated?
thanks,