none
Extending the Entity Data Model Tools RRS feed

  • Question

  • Hey all,

    Not sure if I am in correct forum/forum category but let's try this one.

    For my project I am using VS2015 and EF6 with Database first approach so when I make any change in database and I want it to be reflected in model/code I go to edmx designer and update model from db. This works perfect but let's say that I want to extend this process a little bit.

    For example what if I want to prefix all the entities in model with some string (e.g. for table Users I want to have entity DbUser (or  DtoUser) instead of just User). I can do this for each entity in model manually but well let's say I am lazy...

    Does anybody happen to know if there is a way how to extend/change the process of updating model from db and do this for each entity automatically?

    I have tried to google something and went through msdn site but with no luck. The only thing I have found is this article Extending the Entity Data Model Tools (https://msdn.microsoft.com/en-us/library/ee373852(v=vs.100).aspx) - which seems to be exactly what I need (maybe I am wrong). It says that I can create VS Extension to extend entity data model tool but it refers to 'ADO.NET Entity Data Model Designer Extension Starter Kit' project template and url to this template seems to be broken.

    Cheers,

    Miro

    Saturday, March 5, 2016 7:19 PM

Answers

  • 1st: VS2015 is not supported by the tool you mentioned

    Then roll your own ones,  and there is nothing stopping you from you using a version of VS that it does work on and copying the classes to VS2015. I have done from VS2010 to VS2012 when the tool was not read at the time for VS2012. They are just classes, man.

    2nd: I am more interested in making my own solution by extending the process of updating model from database if it is possible:

    Please proceed in looking to get yourself burnt.

    Saturday, March 5, 2016 8:45 PM

All replies

  • Not sure if I am in correct forum/forum category but let's try this one.

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=adodotnetentityframework

    For example what if I want to prefix all the entities in model with some string (e.g. for table Users I want to have entity DbUser (or  DtoUser) instead of just User). I can do this for each entity in model manually but well let's say I am lazy...

    https://entitiestodtos.codeplex.com/

    Saturday, March 5, 2016 7:42 PM
  • Thanks for the answer although:

    1st: VS2015 is not supported by the tool you mentioned

    2nd: I am more interested in making my own solution by extending the process of updating model from database if it is possible

    Saturday, March 5, 2016 8:13 PM
  • 1st: VS2015 is not supported by the tool you mentioned

    Then roll your own ones,  and there is nothing stopping you from you using a version of VS that it does work on and copying the classes to VS2015. I have done from VS2010 to VS2012 when the tool was not read at the time for VS2012. They are just classes, man.

    2nd: I am more interested in making my own solution by extending the process of updating model from database if it is possible:

    Please proceed in looking to get yourself burnt.

    Saturday, March 5, 2016 8:45 PM
  • Have a look at EF Reverse POCO template...

    Please mark as answer, if this was it. Visit my SQL Server Compact blog http://erikej.blogspot.com

    Monday, March 7, 2016 6:16 PM