In an old project we are using a third party assembly with a class that has a property with some hardcoded information:
public string ConnectionString { get { string[] fullDbName = new string[5]; fullDbName[0] = "Data Source="; fullDbName[1] = this.dbServer; fullDbName[2] = ";Initial Catalog="; fullDbName[3] = this.FullDbName; fullDbName[4] = ";Integrated Security=SSPI;Pooling=false"; return string.Concat(fullDbName); } } I need to be able to construct the connection string my self. So I have tried to make a derived class that hides the original property, but it does not seem to work:
public class SqlServerRestorerExstension : SQLServerRestorer { public SqlServerRestorerExstension(string dbServer, string dbName, string dbFilePath, string dbDataFileName, string dbLogFileName, bool detachOnFixtureTearDown, string connectionstring) : base(dbServer, dbName, dbFilePath, dbDataFileName, dbLogFileName, detachOnFixtureTearDown) { ConnectionString = connectionstring; } public string ConnectionString { get; private set; } } Is it possible do achive this in any way when I don't have acces to the third party code?