none
I have 2 databases and I need to merge its tables into one Context file"XXXX.Context.tt" RRS feed

  • Question

  • Hi,

    I have 2 databases and I have generated 2 edmx files one for each. Then I generated the XXXXXXX.Context.tt and XXXXXXX.tt files for them. So now I have 2

    DB1.edmx

    DB1.Context.tt

    DB1.tt

    DB2.edmx

    DB2.Context.tt

    DB2.tt

    I need to merge the two ".Context.tt"  into one file so I can access all tables from one class and not 2 class.

    Thanks.

    Wednesday, October 15, 2014 1:47 PM

Answers

  • I need to merge the two ".Context.tt"  into one file so I can access all tables from one class and not 2 class.

    I doubt that you can do it.   Why would you even care about it, if you were using a proper DAL and DTO(s) with the DTO(s) being an abstaction away from the database and EF?                

    Wednesday, October 15, 2014 2:35 PM
  • Hello Ahmed,

    I agreed with darnold, I do not think this is possible since one context object could represent for only one database at the same time. If you really want to use only one context, I think one way is to merge two databases to one.

    Fred.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, October 16, 2014 2:53 AM
    Moderator

All replies

  • I need to merge the two ".Context.tt"  into one file so I can access all tables from one class and not 2 class.

    I doubt that you can do it.   Why would you even care about it, if you were using a proper DAL and DTO(s) with the DTO(s) being an abstaction away from the database and EF?                

    Wednesday, October 15, 2014 2:35 PM
  • Hello Ahmed,

    I agreed with darnold, I do not think this is possible since one context object could represent for only one database at the same time. If you really want to use only one context, I think one way is to merge two databases to one.

    Fred.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, October 16, 2014 2:53 AM
    Moderator