Creating many entities
Create many entities
Instead of creating one entity at a time as shown before we can create or save several entities at once using the AddRange
method as shown below
Replace the Program code with the one shown below
If we now take a look at the database we should see several rows in the Students
table
Retrieve many entities
If we wanted to display the information about all the students present in our database, we can loop through the entities as shown below
Replace the Program code with the one shown below
Last updated