Issue while querying MySQL Database with Pomelo Entity Framework Core entity-framework-core mysql


I've a problem with the dotnet core and Pomelo Entity Framework. I'm using ASP.Net Core v1.1 and a MySQL database. The database that I'm using is the employees database, the example in the site of MySQL.

Here is the github repository of my project:

I'm developing a simple web app that queries some tables of the database and shows the data in some pages. I used the ef scaffolding command to create models and dbContext classes.

The problem is that when the app has to render the employees data, it seems blocked and doesn't reply anything. This problem occurs only with the employees table because if I try to visit the departments page, everything goes right and the page is rendered with all the rows of the table.

Is there someone who can help me with?

4/24/2017 10:00:45 AM

Popular Answer

I downloaded your project and applied Migration to create database and tables in my MySQL server using these two commands as I dont have your SQL scripts with data:

Add-Migration <NAME>

Then I added sample data to employees table as shown from below select query:

MariaDB [employees]> select * from employees;
| emp_no | birth_date | first_name | gender | hire_date  | last_name |
|      1 | 2017-04-24 | John       | M      | 2017-04-24 | Smith     |
1 row in set (0.00 sec)

After inserting dummy data, I ran your project and I was able to browse employees index page and was able to retrieve data back in UI. I don't see any problem with your code as I was able to retrieve information back. For your information please see below screenshot:

enter image description here
It would be helpful if you can share more information. We can't see what you are seeing. So please add more information as others have requested. Or else this question shall be closed for lack of information.

4/25/2017 1:45:43 AM

Related Questions


Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow