title: How can I insert data using EntityFramework ?
body: <p>How can I insert data into my database using <code>Entity Framework</code> ?</p>
  
  <p>I'm trying this code bellow, but, in the method <code>AddObject</code> I have to pass 2 parameter:</p>
  
  <ul>
  <li>string entitySetName</li>
  <li>object entity</li>
  </ul>
  
  <p>What is the <code>entitySetName</code> ? 
  The <code>object entity</code> is my model ?</p>
  
  <p><code>EntityNetimoveis.San2011Entities db = new EntityNetimoveis.San2011Entities();</code>
  <code>Model.Gerenciar.UsuarioCurso us = new Model.Gerenciar.UsuarioCurso();</code></p>
  
  <pre><code>public void ProcessRequest(HttpContext context)
      {
          context.Response.ContentType = "text/plain";
  try
      {
          us.Usuario_Id = Convert.ToInt32(context.Request["id"]);
          db.San_UsuarioCurso.Context.AddObject(us);
          db.SaveChanges();
          context.Response.Write("ok");
      }
      catch (Exception e)
      {
          context.Response.Write("");            
      }            
  }
  </code></pre>