locked
How to generate data annotation code from EF designer? RRS feed

  • Question

  • Hi All,

    I want to know how to generate data annotation from EF designer or .edmx file?

    is it possible to do that?

    thanks.

    • Moved by Amanda Zhu Monday, April 8, 2013 8:18 AM
    Friday, April 5, 2013 7:56 AM

Answers

  • Hi pntr;

    Data annotation is used with Code First and NOT with the Entity Framework designer. Database first all the information is modeled from the database definition. Model first you use the entity designer to assign primary key, navigation properties and so on.

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by pntr Monday, April 8, 2013 2:43 PM
    Monday, April 8, 2013 12:31 PM

All replies

  • Hello,

    I have moved this thread to ADO.NET Entity Framework and LINQ to Entities  forum for better response.

    Best regards,


    Amanda Zhu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, April 8, 2013 8:18 AM
  • Hi pntr;

    Data annotation is used with Code First and NOT with the Entity Framework designer. Database first all the information is modeled from the database definition. Model first you use the entity designer to assign primary key, navigation properties and so on.

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    • Marked as answer by pntr Monday, April 8, 2013 2:43 PM
    Monday, April 8, 2013 12:31 PM
  • @ Amanda:

    thanks.

    @ Fernando:

    thanks for your explanation

    Monday, April 8, 2013 2:45 PM