title: How to create entity with nested via LINQ to SQL
body: <p>I got one entity linked with another:</p>
  
  <pre><code>[Table(Name = "Employees")]
  public sealed class Employee
  {
      [Column(Name = "Id", UpdateCheck = UpdateCheck.Never, IsPrimaryKey = true, IsDbGenerated = true, DbType = "Int NOT NULL IDENTITY")]
      public int Id { get; set; }
  
      [Column(Name = "Phone", UpdateCheck = UpdateCheck.Never, DbType = "Char(20)")]
      public string Phone { get; set; }
  
      [Column(Name = "UserId", UpdateCheck = UpdateCheck.Never, DbType = "Int NOT NULL")]
      public int UserId { get; set; }
  
      [Association(Storage = "_user", ThisKey = "UserId")]
      public User User
      {
          get { return _user.Entity; }
          set { _user.Entity = value; }
      }
      private EntityRef&lt;User&gt; _user;
  }
  
  [Table(Name = "Users")]
  public sealed class User
  {
      [Column(Name = "Id", UpdateCheck = UpdateCheck.Never, IsPrimaryKey = true, IsDbGenerated = true, DbType = "Int NOT NULL IDENTITY")]
      public int Id { get; set; }
  
      [Column(Name = "LastName", UpdateCheck = UpdateCheck.Never, DbType = "NVarChar(100)")]
      public string LastName { get; set; }
  
      [Column(Name = "FirstName", UpdateCheck = UpdateCheck.Never, DbType = "NVarChar(100)")]
      public string FirstName { get; set; }
  }
  </code></pre>
  
  <p>Then I want to create an employee:</p>
  
  <pre><code>var entity = new Employee
  {
  Phone = "Some",
  User = new User
  {
      FirstName = "Some", 
      LastName = "Some" 
  }
  };
  
  context.GetTable&lt;Employee&gt;().InsertOnSubmit(entity);
  context.SubmitChanges();
  </code></pre>
  
  <p>And got this:
  The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Employees_Users"</p>
  
  <p>Is it posible to create linked entities in LINQ to SQL? </p>