locked
Customize feed for WCF Data Services using Entity Framework (Code First) RRS feed

  • Question

  • Hello,

    Can anybody tell me how to customize the OData feed for WCF Data Services using Entity Framework (Code First)?

    There is no EDMX file (as it is Code Only).

    I have tried adding the attribute:

    [EntityPropertyMapping( "Id" , SyndicationItemProperty.Title , SyndicationTextContentKind.Plaintext , true )]

    To my POCO classes.

    But it doesn't show anything in the entry title tags!

    I have tried with standard POCO's (with no parent class).

    I have also tried extending POCO's from the EntityObject class.

    EDIT: Anybody?

    Regards,

    Jamie.

    Friday, July 2, 2010 6:16 PM

Answers

  • Hi Jamie,

    Unfortunately, this is not supported. When using the EF provider, mapping is done by adding feed customization attributes to the to the EDMX file. As you mentioned above, since there is no EDMX file in Code Only, this cannot be done. The other method of adding an EntityPropertyMapping attribute to the class is only used with the Reflection provider and won't work in this case.

    Thanks,
    Julian

    • Marked as answer by ScoobyD00UK Friday, July 9, 2010 12:18 PM
    Thursday, July 8, 2010 7:36 PM