Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Do you think this tutorial is wrong or outdated

$
0
0

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,


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>