title: Implement multiple interfaces with a single property in VB.NET
body: <p>On startup, I load all my app.config values into a class named <code>ConfigValues</code>.  My database only needs some of them so I have an <code>IDatabaseConfig</code> interface that specifies just the parameters that it needs.  That way, when I'm creating a database connection class, with constructor injection, I can require that it is passed anything that implements <code>IDatabaseConfig</code>.  </p>
  
  <p>What I'd like to do is declare multiple interfaces on the <code>ConfigValues</code> class and allow some of the properties to implement multiple contracts simultaneously.</p>
  
  <p>Here's a small code example:</p>
  
  <pre class="lang-vb prettyprint-override"><code>Public Interface IAppConfig
      Property Server As String
      Property ErrorPath As String
  End Interface
  
  Public Interface IDatabaseConfig
      Property Server As String
  End Interface
  
  Public Class ConfigValues
      Implements IAppConfig
      Implements IDatabaseConfig
  
      Public Property ErrorPath As String Implements IAppConfig.ErrorPath
  
      'need different syntax - does not compile:
      Public Property Server As String Implements IAppConfig.Server, 
                                       Implements IDatabaseConfig.Server
  
  End Class
  </code></pre>
  
  <p>In VB.NET, is there a way to specify that a single property satisfies the contract for multiple interfaces?</p>
  
  <p>This is the exact opposite of these two questions on SO, which are trying to split up the same interface name into two different properties.</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/q/532148/1366033">Implementing 2 Interfaces with 'Same Name' Properties</a></li>
  <li><a href="https://stackoverflow.com/q/2372726/1366033">How to implement an interface in VB.Net when two methods have the same name but different parameters</a></li>
  </ul>
  
  <hr>
  
  <p>As a cludgy workaround, I could have both properties refer to the same backing property, but I'd have to change the property name on at least one of them, which changes the API.</p>
  
  <pre class="lang-vb prettyprint-override"><code>Private _server As String
  Public Property ServerForApp As String Implements IAppConfig.Server
      Get
          Return _server
      End Get
      Set(value As String)
          _server = value
      End Set
  End Property
  Public Property ServerForDatabase As String Implements IDatabaseConfig.Server
      Get
          Return _server
      End Get
      Set(value As String)
          _server = value
      End Set
  End Property
  </code></pre>