MySQLConnectorNet6.6.5EntityFramework explicitly preload EagerLoadBug bitsCN.com
When migrating the original system from MSSQL to MySQL, the system encountered an inexplicable problem. after elimination, the system tried again and again to lock the problem from the Entity component officially produced by MySQL. After the online search, found similar problems exist for a long time http://bugs.mysql.com/bug.php? Id = 46142, which has not been completely solved yet.
Bug report address: http://bugs.mysql.com/bug.php? Id = 68886
Environment: Entity Framework 4.3.1, database MySQL 5.6.10,. NET 4.0
Define the following classes:
public class Employee { public Employee() { Contracts = new List
(); LongLeaves = new List
(); EmployeeSettlementSettings = new List
(); } [Key] public string BadgeNo { get; set; } public string Name { get; set; } public List
Contracts { get; set; } public List
LongLeaves { get; set; } public List
EmployeeSettlementSettings { get; set; } }
If you explicitly Load (Eager Load) Contracts, LongLeaves, and EmployeeSettlementSettings:
db.Employees.AsNoTracking().Include(i => i.Contracts).Include(i => i.LongLeaves).Include(i => i.EmployeeSettlementSettings).ToList();
The following error is reported:
"String was not recognized as a valid Boolean."
If you only pre-load any of the two items, everything works.
I tried MySQL Connector Net 6.7 Alpha and the same problem exists.
Currently, the solution is to change the way data is obtained (of course, this is only a matter of expediency); the second is to use commercial components: DevArt's dotConnect Professional. it is said that the performance is good and there is no such bug, see here: http://stackoverflow.com/questions/7712620/entity-framework-many-to-many-and-eager-loading
BitsCN.com