2

我正在关注如何在您DateDateTimeODataController

但是我不太明白应该如何实现.AsDate()扩展方法

public static class PrimitivePropertyConfigurationExtensions 
{ 
  public static PrimitivePropertyConfiguration AsDate(this PrimitivePropertyConfiguration property)
  {…}

  public static PrimitivePropertyConfiguration AsTimeOfDay(this PrimitivePropertyConfiguration property)
  {…}
} 

这个...地方有什么?我错过了一些明显的东西吗?

似乎没有任何方法property有意义。

4

1 回答 1

1

按照Date & time mapping with EF

2 Fluent API

public static class PrimitivePropertyConfigurationExtensions 
{ 
  public static PrimitivePropertyConfiguration AsDate(this PrimitivePropertyConfiguration property)
  {
    property.HasColumnType("date");
  }

  public static PrimitivePropertyConfiguration AsTimeOfDay(this PrimitivePropertyConfiguration property)
  {
    property.HasColumnType("time");
  }
} 
于 2016-05-11T07:44:33.657 回答