Monday, March 7, 2011

Entity Framework Mapping, different property name

Hi,

I have a database field called abCode, that I want to map to a property called statusCode in the objectlayer. What changes are needed to the msl, csdl, ssdl and object layer to acomplish this?

Here are the relevent (I think) parts of the files:

In msl:

<ScalarProperty Name="abCode" ColumnName="abCode" />

In csdl:

<Property Name="abCode" Type="Int32" />

In ssdl:

<Property Name="ParentId" Type="int" />

Thanks.

From stackoverflow
  • Through pure trial and error the changes needed are:

    In msl:

    <ScalarProperty Name="statusCode " ColumnName="abCode" />
    

    In csdl:

    <Property Name="statusCode " Type="Int32" />
    

    And in the objectlayer, the private property for abCode changed to StatusCode.

0 comments:

Post a Comment