Skip to content

Instantly share code, notes, and snippets.

@ozgurrgul
Last active October 24, 2017 06:38
Show Gist options
  • Save ozgurrgul/6cf822563d611f042427b56ef0e1ed62 to your computer and use it in GitHub Desktop.
Save ozgurrgul/6cf822563d611f042427b56ef0e1ed62 to your computer and use it in GitHub Desktop.
namespace WebApiJwt.Entities
{
public class ApplicationDbContext : IdentityDbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseMySql(GetConnectionString());
}
private static string GetConnectionString()
{
const string databaseName = "webapijwt";
const string databaseUser = "";
const string databasePass = "";
return $"Server=localhost;" +
$"database={databaseName};" +
$"uid={databaseUser};" +
$"pwd={databasePass};" +
$"pooling=true;";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment