locked
entity dynamic proxies "xxxx" RRS feed

  • Question

  • Hi all,
    I have always inserted my edmx file (DB first approach) and then added my partial classes to extend the methods.
    In this way I also browse the properties
    ex. Article.Brand.Name etc ...

    Now I tried to create the edmx on VS2019 by adding Article.partial.cs to extend my logic, but I find myself in a method as results a list of:
    System.Data.Entity.DynamicProxies.Article_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (x as char and number)

    But this way I can no longer navigate the properties.
    Am I wrong to put the edmx in the right place?
    Or am I wrong to create .partial.cs?

    Obviously replace the edmx every time I need it without rewriting my classes..

    With VS2010 it worked so well!
    I await help
    Graze


    • Edited by duppino Monday, October 26, 2020 8:09 AM
    Monday, October 26, 2020 8:08 AM

Answers

  • IMO,  you should abandon DB first and using the EDMX. You should go with Code First. The EDMX is obsolete in EF Core and not used anymore so you might as will get use to not using an EDMX. Code first can still use the wizard against an existing database to build the EF model classes for EF non Core..
    • Marked as answer by duppino Thursday, October 29, 2020 7:22 AM
    Tuesday, October 27, 2020 3:27 AM
  • So, all the benefits I have with DBFirst will I also have with CodeFirst? Or even more?

    You should be able to use a partial class against the EF model class as before.

    Because I find it so convenient (with dbfirst) to have everything mapped and to be able to use it behind the forms quickly, that I'm afraid to change all my projects..

    You should be able to do the same using Code first against an existing database.

    https://www.entityframeworktutorial.net/code-first/code-first-from-existing-database.aspx


    • Edited by DA924x Tuesday, October 27, 2020 3:40 PM
    • Marked as answer by duppino Thursday, October 29, 2020 7:22 AM
    Tuesday, October 27, 2020 3:40 PM

All replies

  • IMO,  you should abandon DB first and using the EDMX. You should go with Code First. The EDMX is obsolete in EF Core and not used anymore so you might as will get use to not using an EDMX. Code first can still use the wizard against an existing database to build the EF model classes for EF non Core..
    • Marked as answer by duppino Thursday, October 29, 2020 7:22 AM
    Tuesday, October 27, 2020 3:27 AM
  • So, all the benefits I have with DBFirst will I also have with CodeFirst? Or even more?

    Because I find it so convenient (with dbfirst) to have everything mapped and to be able to use it behind the forms quickly, that I'm afraid to change all my projects..

    thanks

    Tuesday, October 27, 2020 6:55 AM
  • So, all the benefits I have with DBFirst will I also have with CodeFirst? Or even more?

    You should be able to use a partial class against the EF model class as before.

    Because I find it so convenient (with dbfirst) to have everything mapped and to be able to use it behind the forms quickly, that I'm afraid to change all my projects..

    You should be able to do the same using Code first against an existing database.

    https://www.entityframeworktutorial.net/code-first/code-first-from-existing-database.aspx


    • Edited by DA924x Tuesday, October 27, 2020 3:40 PM
    • Marked as answer by duppino Thursday, October 29, 2020 7:22 AM
    Tuesday, October 27, 2020 3:40 PM