title: Avoid Validating an Entity Attribute
body: <p>Here is one of my Entityclasses:</p>
  
  <pre><code>public class Customer
  {
      public int Id { get; set; }
      [Required]
      public int CustomerNumber { get; set; }
      [Required]
      [StringLength(50)]
      public string Prename { get; set; }
      [StringLength(50)]
      public string Surname { get; set; }
      public DateTime? Birthday { get; set; }
      public bool Active { get; set; }
      [Column(TypeName = "image")]
      public byte[] Image { get; set; }
  }
  </code></pre>
  
  <p>After adding objects, I used the following line to save my changes:</p>
  
  <pre><code>((IObjectContextAdapter)context).ObjectContext.SaveChanges();
  </code></pre>
  
  <p>Everything worked fine, I was able to save a Customer..</p>
  
  <p>Well now I must change that to the following:</p>
  
  <pre><code>context.SaveChanges();
  </code></pre>
  
  <p>I found out, that my previous line didn't validate, only the second does, because its inheriting from <code>DbContext</code></p>
  
  <p>Now I have the problem that I cannot save a Customer anymore, the reason is, that I got an exception at the <code>context.SaveChanges();</code> Line.</p>
  
  <p>In the <code>EntityValidationError</code> I found the following Error: <strong>ErrorMessage = "The field Image must be a string or array type with a maximum length of '4000'."</strong>
  Well know my question is, how can I avoid validating this one entity only..? I know that there is a possibilty to avoid validating <em>a whole</em> entity, but thats not the idea. I hope someone can help me, I'm stuck at this one..</p>