MYSQL Connection

MYSQL Connection

54696d2054696d20 Posts: 75Questions: 18Answers: 0

I have a .NET Core 2.2 project that uses Identity for Auth. To connect to a Mysql DB I have to use Pomelo.EntityFrameworkCore.MySql package with EF to use Identity. This package doesn't work with DT, It seems that your DBTYPE needs MySql.Data package to use your DT package. Unfortunately, these don't work together. How can I have your package look at Pomelo.EntityFrameworkCore.MySql to connect?

Thanks

Answers

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin

    Yes its possible - you need to use this constructor for the Database instance:

    public Database(string dbType, string str, string adapter = null)
    
    • dbType in this case should be mysql,
    • str is your connection string
    • adapter would be Pomelo.EntityFrameworkCore.MySql.

    I should point out that I've not tested it at all with any of the EF adaptors. The libraries are designed to use a direct ADO.NET connection to the DB. They do not work with EF. I'm unsure if an EF adaptor will present the raw ADO.NET connector.

    Allan

This discussion has been closed.