title: Share an enum between ASMX Web Services
body: <p>I have a web service project with several web services. Two of this web services share an enum that is defined in a BL class, like so:</p>
  
  <pre><code>public class HumanResourcesService
  {
      public SomeLibrary.Employee GetEmployee(int employeeCode)
      {
         var employee = new SomeLibrary.Employee();
         employee.Type= SomeLibrary.EmployeeType.SomeType;
         return employee ;
      }
  }
  
  public class BankService
  {
      public bool ProcessPayment(int employeeCode, EmployeeType employeeType)
      {
          bool processed = false;
          // Boring code
          return processed;
      }
  }
  </code></pre>
  
  <p><em>This is just an example.</em></p>
  
  <p>Both web services, when referenced in a web project, generate a different <code>EmployeeType</code> enum proxies, so I need to cast explicitly to invoke the <code>ProcessPayment</code> method in <code>BankService</code>:</p>
  
  <pre><code>public void SomeMethod(int employeeCode)
  {
       var hrService = new HumanResourcesService();
       var employee = hrService.GetEmployee(employeeCode);
  
       var bankService = new BankService();
       bankService.ProcessPayment(employee.Code, (MyProject.BankService.EmployeeType) employee.Type);
  }
  </code></pre>
  
  <p>I understand .NET has to do this in order to create the WSDL, but can't I somehow make both services refer to the same enum on the proxy classes without breaking anything?</p>