Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Ar33ss Leon4,620 Points
Is it a good practice to modify generated code from Database first?
For example, I do not always create databases in Code first. I like to design my databases in sql server and import them in Entity framework. I noticed EF generates the code for me, but what if I want to make changes? Is it good practice to modify the generated code OR just update my data via sql server?
Chris Roberts-Watts5,434 Points
Why can you not just use EF to regenerate your code again after making changes in SQL server?
I don’t think there is a huge problem in updating your generated EF code but it will become time consuming and more fiddly the larger the database and code base becomes. As mentioned in the video this is why code first was created.