title: Confusion about file.cs name, class name
body: <p>So I am following <a href="http://mikesknowledgebase.azurewebsites.net/pages/Services/WebServices.htm" rel="nofollow">a tutorial</a> to send JSON data to SQL using WCF Service.</p>
  
  <p>Let's say the project is named JsonWcfService.</p>
  
  <p>Inside this project there's a .cs file named <code>Order.cs</code> added:</p>
  
  <pre><code>namespace JsonWcfService
  {
      [DataContract]
      [Serializable]
      public class wsOrder
      {
          [DataMember]
          public int OrderID { get; set; }
  
          //some other fields
      }
  }
  </code></pre>
  
  <p>As you can see, file name and class name are different.</p>
  
  <p>Then, there is function using this class, to deserialize Json data sent, accepting <code>Stream JSONDataStream</code> as parameter:</p>
  
  <pre><code>StreamReader stream = new StreamReader(JSONDataStream);
  string JSONData = stream.ReadToEnd();
  
  JavaScriptSerializer jss = new JavaScriptSerializer();
  wsOrder order = jss.Deserialize&lt;wsOrder&gt;(JSONData);
  </code></pre>
  
  <p>So here the data is deserialized into a single instance of wsOrder class (if I understand that correctly).</p>
  
  <p>Next, we see if there's a record matching our OrderID inside the database:</p>
  
  <pre><code>testDBDataContext dc = new testDBDataContext();
  Order currentOrder = dc.Orders.Where(o =&gt; o.OrderID == order.OrderID).FirstOrDefault();
  </code></pre>
  
  <p>And here's my confusion: <code>Order currentOrder</code> - does it say it is an instance of Order.cs file? Is this a namespace? </p>
  
  <p>When I try to write my own WCF service, and create a <code>Example.cs</code> with <code>public class wsExample</code> inside, it gives me the following error:</p>
  
  <p><code>The type or namespace name 'Example' could not be found (are you missing a using directive or an assembly reference?)</code></p>
  
  <p>when I try to use the same method as described above:</p>
  
  <pre><code>StreamReader stream = new StreamReader(testData);
  string testReceive = stream.ReadToEnd();
  
  JavaScriptSerializer jss = new JavaScriptSerializer();
  wsExample example = jss.Deserialize&lt;wsExample&gt;(testReceive);
  
  testDBDataContext dc = new testDBDataContext();
  Example currentExample = dc.testTable.Where(o =&gt; o.name == example.Name).FirstOrDefault();
  </code></pre>