none
How can generate Self Tracking Entities for C# in Visual Studio 2013 RRS feed

  • Question

  • We have successfully migrated .net project from framework 4.0 to 4.5.1. And it worked neatly. We are using VS 2013

    Now, we started to upgrade EF 4 to EF 6.1.3; And we are having a serious issue.

    This is a very big project, and Self Tracking Entities have been used heavily ... we cannot just change the whole code to remove them, even though Microsoft does not recommend them. It is planned, but it will take some time before we get there.

    My question is simple, is there anyway to integrate an STE code generator to Visual Studio 2013. I know there is EF5.x STE Generator but only for VS 2012.

    Please advise.

    Thanks

    Y. Grib

    • Moved by CoolDadTx Wednesday, March 25, 2015 9:30 PM EF related
    Wednesday, March 25, 2015 7:13 PM

Answers

  • Hello Grib,

    >>is there anyway to integrate an STE code generator to Visual Studio 2013. I know there is EF5.x STE Generator but only for VS 2012.

    Yes, you can.

    Since the STEs are T4 template and you can just take template and code any changes or improvements you require yourselves! As you mentions, there is a EF5.x STE generator, you could download it and edit it. You could check this article: Upgrading to EF6, we could see that from EF5 to EF6, the team moves classes to a new namespace, so we need to modify the T4 template to generate the new namespace.

    Regards.


    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, March 26, 2015 6:10 AM
    Moderator
  • Maybe, you should stop using STE(s). I know I have never used them with using EF in n-tier solutions starting back with EF 3.5.

    https://msdn.microsoft.com/en-us/data/jj613924.aspx?f=255&MSPPError=-2147217396

    I always use DTO(s) that are smart enough to know their state.

    http://www.dailycoding.com/Posts/maintaining_dirty_and_new_state_of_objects.aspx

    And the DTO(s) show how they are to be persisted to the database with EF or no EF in the DAL.

    Thursday, March 26, 2015 5:41 PM

All replies

  • Hello Grib,

    >>is there anyway to integrate an STE code generator to Visual Studio 2013. I know there is EF5.x STE Generator but only for VS 2012.

    Yes, you can.

    Since the STEs are T4 template and you can just take template and code any changes or improvements you require yourselves! As you mentions, there is a EF5.x STE generator, you could download it and edit it. You could check this article: Upgrading to EF6, we could see that from EF5 to EF6, the team moves classes to a new namespace, so we need to modify the T4 template to generate the new namespace.

    Regards.


    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, March 26, 2015 6:10 AM
    Moderator
  • Maybe, you should stop using STE(s). I know I have never used them with using EF in n-tier solutions starting back with EF 3.5.

    https://msdn.microsoft.com/en-us/data/jj613924.aspx?f=255&MSPPError=-2147217396

    I always use DTO(s) that are smart enough to know their state.

    http://www.dailycoding.com/Posts/maintaining_dirty_and_new_state_of_objects.aspx

    And the DTO(s) show how they are to be persisted to the database with EF or no EF in the DAL.

    Thursday, March 26, 2015 5:41 PM