OData metadata doesn't respect fluent API string field definitions

Topics: ASP.NET Web API
Jun 20, 2014 at 10:45 PM
The metadata exposed from OData with a fluent API entity model is missing MaxLength, FixedLength, Unicode, and Nullable indicators. This makes the Create<Entity> methods that are generated in the proxy different from the old versions. The other datatypes generate the Nullable property but strings don't.

WCF Data Services metadata:
  <EntityType Name="ProductFamily">
    <Key>
      <PropertyRef Name="ProductFamilyId"/>
    </Key>
    <Property xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" Name="ProductFamilyId" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity"/>
    <Property Name="ProductFamilyName" Type="Edm.String" MaxLength="100" FixedLength="false" Unicode="true"/>
    <Property Name="Active" Type="Edm.String" Nullable="false" MaxLength="1" FixedLength="true" Unicode="true"/>
    <Property Name="CreatedDate" Type="Edm.DateTime" Nullable="false"/>
    <Property Name="CreatedBy" Type="Edm.Int32" Nullable="false"/>
    <Property Name="UpdatedDate" Type="Edm.DateTime" Nullable="false"/>
    <Property Name="UpdatedBy" Type="Edm.Int32" Nullable="false"/>
  </EntityType>
OData metadata:
<EntityType Name="ProductFamily">
  <Key>
    <PropertyRef Name="ProductFamilyId"/>
  </Key>
  <Property Name="ProductFamilyId" Type="Edm.Int32" Nullable="false"/>
  <Property Name="ProductFamilyName" Type="Edm.String"/>
  <Property Name="Active" Type="Edm.String"/>
  <Property Name="CreatedDate" Type="Edm.DateTime" Nullable="false"/>
  <Property Name="CreatedBy" Type="Edm.Int32" Nullable="false"/>
  <Property Name="UpdatedDate" Type="Edm.DateTime" Nullable="false"/>
  <Property Name="UpdatedBy" Type="Edm.Int32" Nullable="false"/>
</EntityType>