title: Inconsistent accessibility - Developing a Web Service
body: <p>I am trying to create a web service for updating a simple database table. I have an update method which takes a parameter an object of type Employee. I have included a reference of namespace where Employee class belongs. For a reason that I can't understand I receive the following error:
  Inconsistent accessibility: parameter type 'EmployeeDBApplication.Employee' is less accessible than method 'EmployeeStoreWS.EmployeeStoreService.update(EmployeeDBApplication.Employee)'</p>
  
  <pre><code>class Employee
  {
  
      private int id;
  
      public int Id
      {
          get { return id; }
          set { id = value; }
      }
  
      private double salary;
  
      public double Salary
      {
          get { return salary; }
          set { salary = value; }
      }
      private string address;
  
      public string Address
      {
          get { return address; }
          set { address = value; }
      }
      private string firstname;
  
      public string Firstname
      {
          get { return firstname; }
          set { firstname = value; }
      }
      private string lastname;
  
      public string Lastname
      {
          get { return lastname; }
          set { lastname = value; }
      }
  
  
      public override string ToString() {
          string x;
          x = "Employee ID:" + this.id + "\tName:" + this.firstname + "\t" + this.lastname + "\n\tSalary:" + this.salary + "\t Address:" + this.address; 
  
          return x;
      }
  
  }
  </code></pre>
  
  <p>And the web service:</p>
  
  <pre><code>public class EmployeeStoreService : System.Web.Services.WebService
  {
      //id    int(11) NO  PRI 0   
      //firstname varchar(255)    YES         
      //lastname  varchar(255)    YES         
      //address   varchar(255)    YES         
      //salary    double  YES         
  
      [WebMethod]
      public MySqlConnection getConnection()
      {
          return new MySqlConnection("Database=sakila;Data Source=localhost;User Id=root;Password=george 01");
      }
  
      [WebMethod]
      public void update(Employee employee)
      {
          MySqlConnection connection = null;
          try
          {
              connection = getConnection();
              connection.Open();
  
              MySqlCommand myCommand = new MySqlCommand("UPDATE employee SET (?id,?firstname,?lastname,?address,?salary) WHERE employee.id = ?id");
              myCommand.Prepare();
  
              myCommand.Parameters.AddWithValue("?id", employee.Id);
              myCommand.Parameters.AddWithValue("?firstname", employee.Firstname);
              myCommand.Parameters.AddWithValue("?lastname", employee.Lastname);
              myCommand.Parameters.AddWithValue("?address", employee.Address);
              myCommand.Parameters.AddWithValue("?salary", employee.Salary);
  
              myCommand.ExecuteNonQuery();
  
              connection.Close();
  
          }
          catch (Exception ex)
          {
              Console.WriteLine(ex.Message);
          }
          finally
          {
              if (connection != null)
                  connection.Close();
          }
      }
  }
  </code></pre>