locked
Generate table fields in another project in database approach RRS feed

  • Question

  • User-257070954 posted

    HI All

    I am new in entity framework . i am using database first approach.I created a new table in database.
    my Edmx file in one project and i need to generate new tables fields in another project DTO folder . How can i achieve this?

    Tuesday, July 3, 2018 11:40 AM

All replies

  • User475983607 posted

    I am new in entity framework . i am using database first approach.I created a new table in database.
    my Edmx file in one project and i need to generate new tables fields in another project DTO folder . How can i achieve this?

    Your question is a bit confusing.  A DTO is an object that gets filled by an entity, the edmx.  Are you asking how to craft a linq query to populate a DTO?

    Tuesday, July 3, 2018 11:44 AM
  • User-257070954 posted

    My Question is when i give update from database in edmx file i need to generate new file with all properties defined in new table colums in another project DTO folder.
    How its possible?

    Tuesday, July 3, 2018 12:24 PM
  • User475983607 posted

    binustrat

    My Question is when i give update from database in edmx file i need to generate new file with all properties defined in new table colums in another project DTO folder.
    How its possible?

    A DTO is just a class with properties.  DTOs are used to pass data through application layers and commonly made up of one or more entities or bits of entities.  I believe you might be confusing DTO with an entity. 

    If you created a new table then simply update the edmx file to refresh the classes.

    Tuesday, July 3, 2018 1:08 PM
  • User-257070954 posted

    DTO  Class is  autogenerated?

    Tuesday, July 3, 2018 1:17 PM
  • User475983607 posted

    binustrat

    DTO  Class is  autogenerated?

    Not that I'm aware of...

    Entities are auto generated by right clicking on the edmx file and select "Update Model from Database".  A DTO is not an entity.  For the third time, a DTO (Data Transfer Object) is a custom complex class filled by entities.  DTOs are used to pass data between application layers usually in a distributed design.

    https://en.wikipedia.org/wiki/Data_transfer_object

    Tuesday, July 3, 2018 1:24 PM