-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DBの接続設定をconmnectionStringではなく別個で登録するように #17
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the database connection settings by replacing the usage of a unified connection string with separate configuration entries registered via MySqlConnector.
- Introduces a MySqlConnectionStringBuilder with separate configuration values.
- Updates the DbContext setup to use the built connection string.
Files not reviewed (1)
- OngekiMuseumApi/OngekiMuseumApi/appsettings.Development.json: Language not supported
var mySqlConnectionStringBuilder = new MySqlConnectionStringBuilder | ||
{ | ||
Server = builder.Configuration["Database:Server"], | ||
Port = Convert.ToUInt32(builder.Configuration["Database:Port"]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conversion from the configuration value to an unsigned integer may throw an exception if the configuration value is not a valid number. Consider using a safe parsing method like TryParse or adding explicit validation to handle invalid inputs.
Port = Convert.ToUInt32(builder.Configuration["Database:Port"]), | |
Port = TryParseUInt32(builder.Configuration["Database:Port"]), |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
No description provided.