Professional ADO.NET 3.5 with LINQ and the Entity Framework (Wrox Programmer to Programmer)

Professional ADO.NET 3.5 with LINQ and the Entity Framework (Wrox Programmer to Programmer) pdf epub mobi txt 电子书 下载 2026

出版者:Wrox
作者:Roger Jennings
出品人:
页数:634
译者:
出版时间:2009-02-03
价格:USD 49.99
装帧:Paperback
isbn号码:9780470182611
丛书系列:
图书标签:
  • 编程珠玑
  • ADO
  • NET
  • LINQ
  • Entity Framework
  • C#
  • Database
  • Data Access
  • Programming
  • Wrox
  • Developer
  • NET Framework 3
  • 5
想要找书就要到 小美书屋
立刻按 ctrl+D收藏本页
你会得到大惊喜!!

具体描述

Language Integrated Query (LINQ), as well as the C# 3.0 and VB 9.0 language extensions to support it, is the most import single new feature of Visual Studio 2008 and the .NET Framework 3.x. LINQ is Microsoft’s first attempt to define a universal query language for a diverse set of in-memory collections of generic objects, entities persisted in relational database tables, and element and attributes of XML documents or fragments, as well as a wide variety of other data types, such as RSS and Atom syndication feeds. Microsoft invested millions of dollars in Anders Hejlsberg and his C# design and development groups to add new features to C# 3.0—such as lambda expressions, anonymous types, and extension methods—specifically to support LINQ Standard Query Operators (SQOs) and query expressions as a part of the language itself. Corresponding additions to VB 9.0 followed the C# team’s lead, but VB’s implementation of LINQ to XML offers a remarkable new addition to the language: XML literals. VB’s LINQ to XML implementation includes XML literals, which treat well-formed XML documents or fragments as part of the VB language, rather than requiring translation of element and attribute names and values from strings to XML DOM nodes and values. This book concentrates on hands-on development of practical Windows and Web applications that demonstrate C# and VB programming techniques to bring you up to speed on LINQ technologies. The first half of the book covers LINQ Standard Query Operators (SQOs) and the concrete implementations of LINQ for querying collections that implement generic IEnumerable , IQueryable , or both interfaces. The second half is devoted to the ADO.NET Entity Framework, Entity Data Model, Entity SQL (eSQL) and LINQ to Entities. Most code examples emulate real-world data sources, such as the Northwind sample database running on SQL Server 2005 or 2008 Express Edition, and collections derived from its tables. Code examples are C# and VB Windows form or Web site/application projects not, except in the first chapter, simple command-line projects. You can’t gain a feel for the behavior or performance of LINQ queries with “Hello World” projects that process arrays of a few integers or a few first and last names. This book is intended for experienced .NET developers using C# or VB who want to gain the maximum advantage from the query-processing capabilities of LINQ implementations in Visual Studio 2008—LINQ to Objects, LINQ to SQL, LINQ to DataSets, and LINQ to XML—as well as the object/relational mapping (O/RM) features of VS 2008 SP1’s Entity Framework/Entity Data Model and LINQ to Entities and the increasing number of open-source LINQ implementations by third-party developers. Basic familiarity with generics and other language features introduced by .NET 2.0, the Visual Studio integrated development environment (IDE), and relational database management systems (RDBMSs), especially Microsoft SQL Server 200x, is assumed. Experience with SQL Server’s Transact-SQL (T-SQL) query language and stored procedures will be helpful but is not required. Proficiency with VS 2005, .NET 2.0, C# 2.0, or VB 8.0 will aid your initial understanding of the book’s C# 3.0 or VB 9.0 code samples but isn’t a prerequisite. Microsoft’s .NET code samples are primarily written in C#. All code samples in this book’s chapters and sample projects have C# and VB versions unless they’re written in T-SQL or JavaScript. Professional ADO.NET 3.5: LINQ and the Entity Framework concentrates on programming the System.Linq and System.Linq.Expressions namespaces for LINQ to Objects, System.Data.Linq for LINQ to SQL, System.Data.Linq for LINQ to DataSet, System.Xml.Linq for LINQ to XML, and System.Data.Entity and System.Web.Entity for EF’s Entity SQL. “Taking a New Approach to Data Access in ADO.NET 3.5,” uses simple C# and VB code examples to demonstrate LINQ to Objects queries against in-memory objects and databinding with LINQ-populated generic List collections, object/relational mapping (O/RM) with LINQ to SQL, joining DataTable s with LINQ to DataSets, creating EntitySet s with LINQ to Entities, querying and manipulating XML InfoSets with LINQ to XML, and performing queries against strongly typed XML documents with LINQ to XSD. “Understanding LINQ Architecture and Implementation,” begins with the namespaces and C# and VB language extensions to support LINQ, LINQ Standard Query Operators (SQOs), expression trees and compiled queries, and a preview of domain-specific implementations. C# and VB sample projects demonstrate object, array, and collection initializers, extension methods, anonymous types, predicates, lambda expressions, and simple query expressions. “Executing LINQ Query Expressions with LINQ to Objects,” classifies the 50 SQOs into operator groups: Restriction, Projection, Partitioning, Join, Concatenation, Ordering, Grouping, Set, Conversion, and Equality, and then lists their keywords in C# and VB. VS 2008 SP1 includes C# and VB versions of the LINQ Project Sample Query Explorer, but the two Explorers don’t use real-world collections as data sources. This describes a LINQ in-memory object generator (LIMOG) utility program that writes C# 3.0 or VB 9.0 class declarations for representative business objects that are more complex than those used by the LINQ Project Sample Query Explorers. Sample C# and VB queries with these business objects as data sources are more expressive than those using a arrays of a few integers or last names. “Working with Advanced Query Operators and Expressions,” introduces LINQ queries against object graphs with entities that have related (associated) entities. This begins with examples of aggregate operators, explains use of the Let temporary local variable operator, shows you how to use Group By with aggregate queries, conduct the equivalent of left outer joins, and take advantage of the Contains() SQO to emulate SQL’s IN() function. You learn how to compile queries for improved performance, and create mock object classes for testing without the overhead of queries against relational persistence stores. “Using LINQ to SQL and the LinqDataSource,” introduces LINQ to SQL as Microsoft’s first O/RM tool to reach released products status and shows you how to autogenerate class files for entity types with the graphical O/R Designer or command-line SqlMetal.exe . This also explains how to edit *.dbml mapping files in the Designer or XML Editor, instantiate DataContext objects, and use LINQ to SQL as a Data Access Layer (DAL) with T-SQL queries or stored procedures. Closes with a tutorial for using the ASP.NET LinqDataSource control with Web sites or applications. “Querying DataTables with LINQ to DataSets,” begins with a comparison of DataSet and DataContext objects and features, followed by a description of the DataSetExtensions . Next comes querying untyped and typed DataSets, creating lookup lists, and generating LinqDataView s for databinding with the AsDataView() method. This ends with a tutorial that shows you how to copy LINQ query results to DataTable s. “Manipulating Documents with LINQ to XML,” describes one of LINQ most powerful capabilities: managing XML Infosets. This demonstrates that LINQ to XML has query and navigation capabilities that equal or surpasses XQuery 1.0 and XPath 2.0. It also shows LINQ to XML document transformation can replace XQuery and XSLT 1.0+ in the majority of common use cases. You learn how to use VB 9.0’s XML literals to constructs XML documents, use GroupJoin() to produce hierarchical documents, and work with XML namespaces in C# and VB. “Exploring Third-Party and Emerging LINQ Implementations,” describes Microsoft’s Parallel LINQ (also called PLINQ) for taking advantage of multiple CPU cores in LINQ to Objects queries, LINQ to REST for translating LINQ queries into Representational State Transfer URLs that define requests to a Web service with the HTML GET, POST, PUT, and DELETE methods, and Bart De Smet’s LINQ to Active Directory and LINQ to SharePoint third-party implementations. “Raising the Level of Data Abstraction with the Entity Data Model,” starts with a guided tour of the development of EDM and EF as an O/RM tool and heir apparent to ADO.NET DataSets, provides a brief description of the entity-relationship (E-R) data model and diagrams, and then delivers a detailed analysis of EF architecture. Next comes an introduction to the Entity SQL (eSQL) language, eSQL queries, client views, and Object Services, including the ObjectContext , MetadataWorkspace , and ObjectStateManager . Later chapters describe eSQL and these objects in greater detail. Two C# and VB sample projects expand on the eSQL query and Object Services sample code. “Defining Conceptual, Mapping, and Storage Schema Layers,” provides detailed insight into the structure of the *.edmx file that generates the *.ssdl (storage schema data language), *.msl (mapping schema language), and *.csdl files at runtime. You learn how to edit the *.edmx file manually to accommodate modifications that the graphic EDM Designer can’t handle. You learn how to implement the Table-per-Hierarchy (TPH) inheritance model and traverse the MetadataWorkspace to obtain property values. Four C# and VB sample projects de...

作者简介

目录信息

读后感

评分

评分

评分

评分

评分

用户评价

评分

从实战应用的角度来看,这本书的价值在于它提供了一个完整的、可参考的范例架构。它不仅仅是介绍API,更重要的是将ADO.NET、LINQ和EF集成到一个统一的数据访问层(DAL)中进行讲解。作者在构建这个范例时,考虑到了分层架构的清晰性、代码的可测试性,以及如何优雅地处理数据库迁移问题。我特别欣赏作者在讲解如何封装数据访问逻辑,使其对上层业务逻辑完全透明的处理方式。这对于构建企业级应用至关重要。书中涉及到了一些关于Repository Pattern和Unit of Work Pattern在3.5框架下具体实现的讨论,这些模式在当时是构建可测试数据层的金标准。虽然现在看来,这些设计模式在更新的框架中有了更自然的体现方式,但理解这种经典实现的思路,对于理解当前框架的演进脉络是不可或缺的。

评分

这本书的封面设计倒是挺引人注目的,那种经典的Wrox风格,一看就知道是面向实战派程序员的。我当初买它的时候,主要是冲着“ADO.NET 3.5”这个版本去的,毕竟那时候3.5还是主流,想把手头的旧项目升级一下,顺便看看微软在数据访问层方面的新动向。翻开目录,内容涵盖了从基础的`SqlConnection`到更复杂的事务处理,还有一些关于数据绑定和数据适配器的深入讨论。说实话,对于一个有几年经验的.NET开发者来说,这些基础内容很多是已经掌握的,但作者对细节的阐述,比如性能调优的小技巧,还是很有价值的。我记得里面有一章专门讲如何高效地使用`DataAdapter`进行批量更新,那段代码示例非常清晰,帮我解决了一个困扰已久的数据同步问题。不过,对于完全的新手来说,可能需要一点耐心,因为它不会花太多篇幅去解释最基本的C#语法或者数据库原理,它默认你已经具备一定的背景知识。整体来看,作为一本工具书,它的结构是严谨且实用的,更像是一个技术手册,而不是一本入门教程。

评分

阅读体验上,这本书的风格非常直接,基本没有过多的闲聊和背景铺垫,每一页都塞满了代码示例和技术要点。这对于我这种喜欢快速获取知识的读者来说,是优点,但也可能是某些人的痛点。如果你期待那种循序渐进、充满比喻的教学方式,这本书可能不太适合你。它更像是一个资深架构师在你旁边,边写代码边给你讲解每一个关键决策背后的考量。我对其中关于自定义数据类型和复杂对象图谱映射的章节印象深刻,它展示了如何超越框架的默认设置,实现高度定制化的数据持久层。书中给出的解决方案往往不是最简单的,但却是最健壮、最可维护的。当然,这也意味着你需要投入大量时间去消化那些密集的术语和复杂的配置步骤。每当遇到新的概念,我都会立刻打开Visual Studio进行同步实践,否则很容易在阅读过程中迷失方向。

评分

这本书的排版和索引做得相当不错,这一点必须肯定。对于一本技术参考书而言,能否快速定位所需信息,直接影响了它的实用价值。当你遇到一个棘手的连接字符串问题或者需要快速回顾一下异步数据操作的语法时,清晰的章节划分和详细的索引能让你事半功倍。我记得有一次紧急修复一个线上bug,涉及到旧版数据上下文的并发控制问题,我正是通过快速翻阅索引,定位到了那几页关于乐观并发检查的讨论,找到了解决方案的关键点。相比于依赖在线文档搜索,这种实体书的快速检索能力在压力下显得尤为可靠。总而言之,它更像是一个陪伴你度过职业生涯中若干个版本迭代的“老伙计”,虽然界面可能陈旧,但其核心知识的扎实程度,足以让你在面对任何基于ADO.NET 3.5及早期EF的应用时,都能从容不迫地进行维护和优化。

评分

这本书的侧重点明显偏向于技术实现的深度挖掘,尤其在LINQ to Entities的部分,讲解得相当细致。我当时最感兴趣的就是如何将复杂的业务逻辑转化为简洁的LINQ查询表达式,而不是写一堆冗长且容易出错的SQL字符串。作者花了大量篇幅解析了LINQ查询的编译过程,甚至触及了部分查询提供者的内部工作原理,这对于那些想写出“高性能”LINQ代码的开发者来说,简直是如获至宝。有一部分内容专门对比了延迟加载(Lazy Loading)和预加载(Eager Loading)在不同场景下的性能差异,并给出了明确的建议。我记得那部分图表做得非常直观,让你一眼就能看出在何种查询结构下,哪种加载策略是更优解。虽然Entity Framework 3.5的时代已经过去很久了,但理解其背后的设计哲学,对于理解后续EF版本,乃至其他ORM框架的机制,都是有莫大裨益的。它教你的不只是“怎么写”,更是“为什么这样写”。

评分

评分

评分

评分

评分

本站所有内容均为互联网搜索引擎提供的公开搜索信息,本站不存储任何数据与内容,任何内容与数据均与本站无关,如有需要请联系相关搜索引擎包括但不限于百度google,bing,sogou

© 2026 book.quotespace.org All Rights Reserved. 小美书屋 版权所有