MySQLConnectorNet6.6.5EntityFramework explicitly preload Eager_MySQL

Source: Internet
Author: User
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
Related Article
Large-Scale Price Reduction
  • 59% Max. and 23% Avg.
  • Price Reduction for Core Products
  • Price Reduction in Multiple Regions
undefined. /
Connect with us on Discord
  • Secure, anonymous group chat without disturbance
  • Stay updated on campaigns, new products, and more
  • Support for all your questions
undefined. /
Free Tier
  • Start free from ECS to Big Data
  • Get Started in 3 Simple Steps
  • Try ECS t5 1C1G
undefined. /

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.