how to connect mysql to .net program as 2nd db
I'm using mongodb in my program and I want to add second db and I decided to MySQL. I created the mysql container but don'tknow how to connect to program.



DbSet<T>DbSet<T>_context.Posts.Add(new Post(...));Find(int id) // Replace 'YourDbContext' with the name of your own DbContext derived class.
services.AddDbContext<YourDbContext>(
dbContextOptions => dbContextOptions
.UseMySql(connectionString, serverVersion)
// The following three options help with debugging, but should
// be changed or removed for production.
.LogTo(Console.WriteLine, LogLevel.Information)
.EnableSensitiveDataLogging()
.EnableDetailedErrors()
);