title: Return config URLs based on Database stored values
body: <p><b>Problem  trying to solve:</b> Move the URLS from the config and use class type to dynamically substitute the URL. I have one Website configured in IIS with multiple Host Names.</p>
  <p>I am working on Art Academy website using .NET Framework WEB API + React (SPA).
  Students have two option of ClassType - it can be either 1) Dance Or 2) Art</p>
  <pre><code>&gt; if Dance is choosen i want them to see URL  - myDomain.classesForDance.com
  &gt; else if Art is choosen  i want them to see URL - myDomain.classesforArt.com
  </code></pre>
  <p>Both URL points to same website except change in LOGO and some other minor details
  which are handled in code  based on <code>classType</code> selected by the students</p>
  <p>I am trying to resolve how do i go about IIS binding with multiple host names so that i don't have to manage two websites. IIS will have one website where it points to two Host Names as below:</p>
  <ol>
  <li>myDomain.classesForDance.com</li>
  <li>myDomain.classesforArt.com</li>
  </ol>
  <p>In the <code>appSettings.config (web.config)</code> I have URL for various environments like QA, Stage, Prod etc</p>
  <p>For example, on QA</p>
  <ul>
  <li>SignInUrl=&quot;http://login.qa.classesForDance.net/auth?siteCode=DANCE&quot;</li>
  <li>AuthenticationDomain=&quot;.qa.classesForDance.net&quot;</li>
  </ul>
  <p>What i want to do is, i want to dynamically send back URL like
  Either  LogInUrl=<code>http://login.qa.classesForDance.net/auth?siteCode=DANCE</code>
  OR      LogInUrl=<code>http://login.qa.classesforArt.net/auth?siteCode=ART</code>
  based on student's class selected as per their profile. Move the URLS from the config and use selected class type to dynamically substitute the URL.</p>
  <p>How do i go about solving this problem</p>
  <p><B>Note**</B> System.Web.Hosting.HostingEnvironment won't solve as  I can only access properties like SiteName etc.
  What i need is correct URL based on ClassType students have opted for.</p>
  <p>One solution i have thought so far is to come up with a service which first reads the DB and replaces the <code>appSettings.config</code> - config URL based on <code>ClassType</code>. I don't want to add more Keys to AppSettings for another hostname, for example what if i add another <code>classType - singing</code> in future - the design should be able to accommodate easily without much changes in code and simply by adding one more classType in DB - return <code>myDomain.classesforSinging.com</code></p>
  <p>Is there any better or alternative approach someone can suggest? Anything i need to consider while handling this problem?</p>