I'm a noob on EF and WebApi, and I've been with this problem for hours now, I searched internet and SO for the solution but any of them fixed my case.
I have a simple website, using Entity Framework and Web Api. The problem is that I cannot estabilish connection with database, I keep getting the error "Format of the initialization string does not conform to specification starting at index 0". The website is still local, and the database is local too.
The error shows up on this part of GenericRepository (only changed names here):
public GenericRepository(DoacoesContext db)
{
_db = db;
_dbSet = _db.Set<TEntity>();
Console.WriteLine("Conexão: " + _db.Database.Connection.ConnectionString); //here
}
Here is my connection string:
<connectionStrings>
<add name="name" connectionString="Server=localhost;Database=example;Uid=root;Pwd=admin;" providerName="MySql.Data.MySqlClient" />
I've been here already (and some other posts and websites):
Format of the initialization string does not conform to specification starting at index 0
How to fix error ::Format of the initialization string does not conform to specification starting at index 0::
Here is the error on XML (after server response):
https://i.gyazo.com/19960b18f293187c269936cae7f2d360.png
Any clues on fixing it? I can show more code if needed.
Thanks in advance!