title: Case Sensitive with Entity Framework Code First
body: <p>I create database with Entity Framework CodeFirst. I look other questions but any of them has not spesific answer.I try to save this two KEY's as a different rows to my table.:</p>
  
  <p>12E60AED-7491-49B3-8006-78ECEA63B376
  12e60aed-7491-49b3-8006-78ecea63b376</p>
  
  <p>This is my class for attribute:</p>
  
  <pre><code>[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
      public class CaseSensitive : Attribute
      {
              public CaseSensitive()
              {
                  IsEnabled = true;
              }
              public bool IsEnabled { get; set; }
      }
  </code></pre>
  
  <p>This is my db model:</p>
  
  <pre><code>[Table("StandardBusinessDocument", Schema = "EFatura")]
      public class StandardBusinessDocument{
          [Key]
          [Column( TypeName= "varchar" , Order =0), MaxLength(36) ]
          [CaseSensitive]
          public string StandardBusinessDocumentGuid { get; set; }
  
          [Key]
          [Column(TypeName = "bit", Order = 1)]
          public Boolean StandardBusinessDocumentType { get; set; }
  
          [Column(TypeName = "varchar"), MaxLength(4)]
          public string Code{ get; set; }
  }
  </code></pre>
  
  <p>An this is entityContex:</p>
  
  <pre><code>    protected override void OnModelCreating(DbModelBuilder modelBuilder)
          {
              modelBuilder.Conventions.Add
                  (new AttributeToColumnAnnotationConvention&lt;CaseSensitive, bool&gt;
                  ("CaseSensitive", (property, attributes) =&gt; attributes.Single().IsEnabled));
  }
  </code></pre>
  
  <p>But it doesnt work, when I look caseSensitive from tableDesigner-Collation CaseSensitive is disabled. How can I work it?</p>