title: SQL 'time' type in Entity Framework Code First
body: <p>I'm trying to create a 'time(7)' column in a table with Entity Framework Code First. This is my Entity:</p>
  
  <pre><code>public class ShiftDetail
  {
      public long Id { get; set; }
  
      [Required]
      public int DayOfWeek { get; set; }
  
      [Required]
      [Column(TypeName="time")]
      public DateTime StartTime { get; set; }
  
      [Required]
      [Column(TypeName = "time")]
      public DateTime EndTime { get; set; }
  
      public long ShiftId { get; set; }
      public virtual Shift Shift { get; set; }
  }
  </code></pre>
  
  <p>As you can see I'm trying to set the database type for the columns StartTime and EndTime to "time" but I get this error:</p>
  
  <blockquote>
    <p>(112,12) : error 2019: Member Mapping specified is not valid. The type 'Edm.DateTime[Nullable=False,DefaultValue=,Precision=]' of member 'StartTime' in type 'ShiftDetail' is not compatible with 'SqlServer.time[Nullable=False,DefaultValue=,Precision=7]' of member 'StartTime' in type 'CodeFirstDatabaseSchema.ShiftDetail'.</p>
  </blockquote>
  
  <p>I've tried also with TypeName="time(7)" but I get this other error:</p>
  
  <blockquote>
    <p>(104,6) : error 0040: The Type time(7) is not qualified with a namespace or alias. Only primitive types can be used without qualification.</p>
  </blockquote>
  
  <p>How can I create a time column with code first? (preferably without fluent API)</p>
  
  <p>Thanks in advance.</p>