Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-31180-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 27th, 2014, 09:40 PM
Authorized User
 
Join Date: Nov 2013
Posts: 10
Thanks: 3
Thanked 0 Times in 0 Posts
Default LINQ ADO.NET code generator strategy

Hello Imar,

What is the difference between the code generator strategy property in the ADO.NET model?

In your book, you said that the code generator strategy property will have either option DEFAULT or NONE, but in my IDE (Visual Studio Express Web 2013), the code generator strategy has T4 or Legacy Object Context. Can you briefly explain which one I should choose and what each of them does?

Thanks
 
Old March 28th, 2014, 06:21 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

With T4 you get the ability to override the generated code by modifying the T4 templates. By default, the code that generates uses EF Code First so your classes don't inherit a base class and it uses the new DbContext. With the legacy version, the code creates classes that inherit EntityObject and use ObjectContext for the database access.

You probably want to choose the T4 option for new projects as it'll be easier to work with.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old April 2nd, 2014, 04:34 PM
Authorized User
 
Join Date: Nov 2013
Posts: 10
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Thanks Imar, that would work.





Similar Threads
Thread Thread Starter Forum Replies Last Post
PLEASE HELP WITH THE ERROR IN Chapter 14 LINQ and the ADO.NET Entity Framework Tobi BOOK: Beginning ASP.NET 4 : in C# and VB 2 February 19th, 2014 08:03 AM
Chapter 14 LINQ ADO.NET EF ecdhyne BOOK: Beginning ASP.NET 4.5 : in C# and VB 1 June 21st, 2013 03:45 PM
Chapter 14 Linq and ado.net entity framework pandukal21 BOOK: Beginning ASP.NET 4 : in C# and VB 8 January 28th, 2011 05:19 AM
confusing in ADO.NET Entity Data Model,Linq to sql angelboy ADO.NET 5 November 21st, 2008 05:01 PM
Should I learn ado.net Or linq? chobo2 LINQ 2 January 4th, 2008 06:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.