Sayfalar

5 Şubat 2011 Cumartesi

ASP.NET 3.5


Developers who are facing ASP.NET 3.5 for the first time are likely to wonder what happened to ASP.NET
3.0. Oddly enough, it doesn’t exist. Microsoft used the name .NET Framework 3.0 to release new
technologies—most notably, WPF (Windows Presentation Foundation), a slick new user interface
technology for building rich clients, WCF (Windows Communication Foundation), a technology for
building message-oriented services, and WF (Windows Workflow Foundation), a technology that allows
you to model a complex business process as a series of actions (optionally using a visual flowchart-like
designer). However, the .NET Framework 3.0 doesn’t include a new version of the CLR or ASP.NET.
Instead, the next release of ASP.NET was rolled into the .NET Framework 3.5.
Compared to ASP.NET 2.0, ASP.NET 3.5 is a more gradual evolution. Its new features are
concentrated in two areas: LINQ and Ajax, as described in the following sections.
LINQ
LINQ (Language Integrated Query) is a set of extensions for the C# and Visual Basic languages. It allows
you to write C# or Visual Basic code that manipulates in-memory data in much the same way you query
a database.
Technically, LINQ defines about 40 query operators, such as select, from, in, where, and orderby (in
C#). These operators allow you to code your query. However, there are various types of data on which
this query can be performed, and each type of data requires a separate flavor of LINQ.
The most fundamental LINQ flavor is LINQ to Objects, which allows you to take a collection of
objects and perform a query that extracts some of the details from some of the objects. LINQ to Objects
isn’t ASP.NET-specific. In other words, you can use it in a web page in exactly the same way that you use
it in any other type of .NET application.
Along with LINQ to Objects is LINQ to DataSet, which provides similar behavior for querying an inmemory
DataSet object, and LINQ to XML, which works on XML data. But one of the most interesting
flavors of LINQ is LINQ to Entities, which allows you to use the LINQ syntax to execute a query against a relational database. Essentially, LINQ to Entities creates a properly parameterized SQL query based on
your code, and executes the query when you attempt to access the query results. You don’t need to write
any data access code or use the traditional ADO.NET objects.
LINQ to Objects, LINQ to DataSet, and LINQ to XML are features that complement ASP.NET, and
aren’t bound to it in any specific way. However, ASP.NET includes enhanced support for LINQ to
Entities, including a data source control that lets you perform a query through LINQ to Entities and bind
the results to a web control, with no extra code required. You’ll take a look at LINQ to Objects, LINQ to
DataSet, and LINQ to Entities in Chapter 13. You’ll consider LINQ to XML in Chapter 14.

Hiç yorum yok:

Yorum Gönder

Bing'ı Seviyoruz. :)
Google'ı Seviyoruz. :)