entity 오류로인해 제거해야해서 . 제거전 백업
This commit is contained in:
30
DBMigration/Models/ConnectionInfo.cs
Normal file
30
DBMigration/Models/ConnectionInfo.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
namespace DBMigration.Models
|
||||
{
|
||||
public class ConnectionInfo
|
||||
{
|
||||
public string ServerName { get; set; } = string.Empty;
|
||||
public string DatabaseName { get; set; } = string.Empty;
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
public string Password { get; set; } = string.Empty;
|
||||
public bool UseWindowsAuthentication { get; set; }
|
||||
|
||||
public string GetConnectionString()
|
||||
{
|
||||
var builder = new Microsoft.Data.SqlClient.SqlConnectionStringBuilder
|
||||
{
|
||||
DataSource = ServerName,
|
||||
InitialCatalog = DatabaseName,
|
||||
IntegratedSecurity = UseWindowsAuthentication,
|
||||
TrustServerCertificate = true
|
||||
};
|
||||
|
||||
if (!UseWindowsAuthentication)
|
||||
{
|
||||
builder.UserID = UserId;
|
||||
builder.Password = Password;
|
||||
}
|
||||
|
||||
return builder.ConnectionString;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user