.Net Core Entity Framework - Reading Multiple Entities

I used the programming code of the first code with the Framework entity in the .net core. I have created a database that works great and I can save the data.

The data is stored in a SQLite database. When I look at the database I see that there are columns inserted and data is available.

Now I would like to read Data from the database. In this case, I am using the following code:

DatabaseContext db = new DatabaseContext();
MicroserviceMetric result = db.MicroserviceMetrics.LastOrDefault();

      

A database context is a context that represents a database. There is a MicroServiceMetrics DbSet which contains various MicroserviceMetric Type classes. This class also has several different objects and lists, but in any case, the data can be inserted correctly.

But the example is from above. Returns only the resulting primitive primary key of the data type, which is represented as an integer. Other objects are not readable and there is zero, although the data is available in the database.

I've tried many different things but it doesn't work.

+3


source to share





All Articles