LINQ via C# 系列文章

LINQ via C#

Recently I am giving a series of talk on LINQ. the name “LINQ via C#” is copied from “ CLR via C# ”, one of my favorite books. Currently part 1 – 8 are finished, and the entire series should be 10 parts. The contents are: Introducing LINQ What Is LINQ

LINQ via C# Events Posters Design

10 LINQ via C# events have been held successfully. Each event is a pure English speaking technical talk. I designed some posters for the events, with no enough time to design for each event. LINQ via C# part 4 In part 3, lambda expression of C# is introduced...
Introducing LINQ (1) What Is LINQ

[ LINQ via C# series ] This LINQ series is from my 10 parts of LINQ via C# talks . And the poster designs for the events are here . What is LINQ Here is the roadmap of .NET and C#: Date .NET Framework CLR C# IDE Introduced Features February 13th, 2002...
Introducing LINQ (2) Advancements Overview

[ LINQ via C# series ] According to MSDN : LINQ is one of Microsoft’s most exciting, powerful new development technologies. Independent to data source This sample mentioned in part 1 is working on items in a .NET array: var results = from number in source...
Understanding C# 3.0 Features (1) Automatic Property

[ LINQ via C# series ] As the fundamental of LINQ, This chapter will explain the new language features of C# 3.0, all of which are syntactic sugars. This part is about the automatic property. In C# 2.0 a property can be declared like this: public class...
Understanding C# 3.0 Features (2) Object Initializer And Collection Initializer

[ LINQ via C# series ] Take this Person type as an example: public class Person { public string Name { get ; set ; } public int Age { get ; set ; } } Object initializer In C# 2.0 we create an Person instance and initialize it like this: Person person...
Understanding C# 3.0 Features (3) Type Inference

[ LINQ via C# series ] The “var” keyword has been introduced from the beginning . It is a new language feature called type inference in C# 3.0. Local variable type inference Consider the local variable declaration and initialization: TypeName a = b; Since...
Understanding C# 3.0 Features (4) Anonymous Type

[ LINQ via C# series ] This feature provides a way to create an instance without declare the type: var mark = new { Name = "Mark" , Age = 18 }; Since the type name is unknown at this time when writing code, this is called a anonymous type. Compilation...
Understanding C# 3.0 Features (5) Extension Method

[ LINQ via C# series ] Extension method is a fancy and powerful syntactic sugar in C# 3.0. Extension methods are very important when writing functional style C# code. Define an extension method for a class When we define an extension method for a type...
Understanding C# 3.0 Features (6) Lambda Expression

[ LINQ via C# series ] Lambda expression is another powerful syntactic sugar making C# functional. In this post, “Lambda expression” simply means “C# Lambda expression”. The native concept of lambda expression will be introduced in the later lambda calculus...
Understanding C# 3.0 Features (7) Query Expression

[ LINQ via C# series ] This kind of code has been introduced again and again: var positive = from number in source where number > 0 orderby number descending select number.ToString( CultureInfo .InvariantCulture); This is called the query expression...

Understanding C# 3.0 Features (8) Partial Method

[ LINQ via C# series ] The is a very simple feature. From partial class to partial method Partial class is introduced by C# 2.0. With the partial keyword, the definition of one type is able to be divided into several files. For example, if creating a...
Understanding LINQ to Objects (1) Programming Paradigm

[ LINQ via C# series ] Declarative vs. imperative This post mentioned that LINQ introduced new programming constructs to C#. Take a look at the samples in the beginning post : int [] source = new int [] { 0, -5, 12, -54, 5, -67, 3, 6 }; List < int...
Understanding LINQ to Objects (2) Method Chaining

[ LINQ via C# series ] It is obvious the Where(), OrderBy(), Select() can be invoked fluently: int [] source = new int [] { 0, 1, -2, 3, 24, 6, 3 }; var results = source.Where(item => item > 0 && item < 10) .OrderBy(item => item) ...
Understanding LINQ to Objects (3) Query Methods

[ LINQ via C# series ] After understanding the programming paradigm and why LINQ query methods can be chaining , this post shows the details of LINQ query methods. Methods like Where(), OrderBy(), OrderByDescending(), and Select() are exhibited again...
Understanding LINQ to Objects (4) Iterator Pattern

[ LINQ via C# series ] According to Wikipedia : Iterator pattern is a design pattern in which iterators are used to access the elements of an aggregate object sequentially without exposing its underlying representation. An Iterator object encapsulates...
Understanding LINQ to Objects (5) Implementing Iterator

[ LINQ via C# series ] Iterator pattern is the core pattern of LINQ to Objects implementation. To filter, order, or project the data items of a data collection, of course the code need to go through the collection and figure out the results. The previous...
Understanding LINQ to Objects (6) Deferred Execution

[ LINQ via C# series ] One post at the beginning of this series mentioned that deferred execution is a important advancement of LINQ. The following code show how is the execution deferred: IEnumerable < int > source = Enumerable .Range(-2, 5); ...
Understanding LINQ to Objects (7) Query Methods Internals

[ LINQ via C# series ] This post explains how are the LINQ to Objects standard query methods implemented. Once again, it will be exhibited that iterator pattern is the core pattern of LINQ to Objects query. The first thing need to emphasize is, not all...
Understanding LINQ to Objects (8) The Design Of IEnumerable

[ LINQ via C# series ] Currently in .NET, iterator pattern is implemented via IEnumerable and IEnumerator (or IEnumerable and IEnumerator): namespace System.Collections { // Represents a collection which can be iterated. public interface...
Understanding LINQ to SQL (1) Object-Relational Mapping

[ LINQ via C# series ] According to Wikipedia , Object-relational mapping is: a programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages. This is the LINQ to SQL sample...
Understanding LINQ to SQL (2) IQueryable

[ LINQ via C# series ] The core of LINQ to Objects is IEnumerable: Query methods are designed for IEnumerable as extension methods , like Where(), Select(), etc.; Query methods are designed to be fluent, LINQ to Objects queries can be...
Understanding LINQ to SQL (3) Expression Tree

[ LINQ via C# series ] In LINQ to Objects, lamda expressions are used everywhere as anonymous method, like Where(): public static IEnumerable Where( this IEnumerable source, Func predicate...
Understanding LINQ to SQL (4) Data Retrieving Via Query Methods

[ LINQ via C# series ] After understanding: object model generating from SQL Server schema query method chaining on IQueryable SQL are translated from expression tree, which is required by IQueryable now it is time to take a deeper look...
Understanding LINQ to SQL (5) Remote And Local Method Call

[ LINQ via C# series ] Since LINQ to SQL is translating C# methods into SQL, all the C# methods are required to make sense in SQL. According to MSDN : A local method call is one that is executed within the object model. A remote method call is one that...
Understanding LINQ to SQL (6) Working With Deferred Execution

[ LINQ via C# series ] Similar with LINQ to Objects, LINQ to SQL supports deferred execution when possible. For example: using ( NorthwindDataContext database = new NorthwindDataContext ()) { IQueryable < Category > source = database.Categories;...
Understanding LINQ to SQL (7) Data Changing

[ LINQ via C# series ] After understanding how to retrieve data with LINQ to SQL, now take a look at data change (create (insert) / update / delete). Object Identity When changing data queried by LINQ to SQL, one common confusion for LINQ to SQL beginners...
Understanding LINQ to SQL (8) Transaction

[ LINQ via C# series ] Database data Changing cannot be talked about without transactions . Implementing TRANSACTION (BEGIN / COMMIT / ROLLBACK) The previous post has shown that, when invoking SubmitChanges(), the translated SQL (INSERT / UPDATE / DELETE...
Understanding LINQ to SQL (9) Concurrent Conflict

[ LINQ via C# series ] Conflicts are very common when concurrently accessing the same data. Conflicts in concurrent data access The following code presents the concurrent conflict scenario: Action < int , Action < Category >> updateCategory...
Understanding LINQ to SQL (10) Implementing LINQ to SQL Provider

[ LINQ via C# series ] So far LINQ to SQL data CRUD (Creating / Retrieving / Updating / Deleting) has been explained. This post takes a deeper look at the internal implementation of LINQ to SQL query. The provider model Unlike IEnumerable / IEnumerable...
Understanding LINQ to SQL (11) Performance

[ LINQ via C# series ] LINQ to SQL has a lot of great features like strong typing query compilation deferred execution declarative paradigm etc., which are very productive. Of course, these cannot be free, and one price is the performance. O/R mapping...

时间: 2024-10-02 00:08:40

LINQ via C# 系列文章的相关文章

在新的平台上编程 ----微软 .NET平台系列文章之一(译文/赵湘宁 )

编程|微软 在新的平台上编程 ----微软 .NET平台系列文章之一 译文/赵湘宁     一年多来,我将注意力一直放在微软的.NET CLR(公共语言运行时:Common Language Runtime)平台.在我看来,今后大多数新的开发都将面向这个平台,因为它使应用程序的开发变得更容易.更简单.同时,我还期望现有的应用开发能迅速移到.NET平台上来.    为了帮助开发人员掌握这个新的平台,本文以及以后的系列文章将专门针对.NET讨论各种编程问题.我将假设你已经熟悉面向对象的编程概念.每一

稳扎稳打Silverlight 3.0系列文章索引

相关文章:稳扎稳打Silverlight 2.0系列文章索引 在线DEMO http://www.cnblogs.com/webabcd/archive/2009/08/04/1538238.html 1.稳扎稳打Silverlight(33) - 3.0控件之AutoCompleteBox,DataPager 介绍 Silverlight 3.0 控件一览: AutoCompleteBox - 自动完成控件.当用户输入部分信息后,此控件可以基于指定的过滤算法在一个下拉框中陈列出匹配项 Data

系出名门 Android系列文章索引

介绍 系出名门 Android 系列文章索引:搭建开发环境, 布局, 菜单, 对话框, 通知, 活动, 服务, 广播, 广播接收器, 控件, 数据库支持, 内容提供器, HTTP通信, XML解析, 异步消息处理 1.系出名门Android(1) - 在 Windows 下搭建 Android 开发环境,以及 Hello World 程序 介绍 搭建 Android 的开发环境,以及写一个简单的示例程序 在 Windows 下搭建 Android 开发环境 Android 项目的目录结构说明 写

DNN模块开发系列文章(7)——用CodeSmith Templates进行编码

在利用CodeSmith Templates进行代码编写之前,我们应该先完成数据表的设计.因为CodeSmith Templates是根据数据表的字段来生成相应代码的. 首先根据<DNN模块开发系列文章(1)--分析设计>中对MyCompany_Article文章信息表的定义在SQL Server数据库中进行设计.记住要设计好主外键,特别是与Modules表的关联. 其次,我们还可以将程序所用到存储过程先编写好.在编写存储过程时,我们可以利用CodeSmith Templates中Stored

DNN模块开发系列文章(6)——DNN中的通用控件(下)

TextEditor: 开发系列文章(6)--DNN中的通用控件(下)-通用语言模块">简介: 富文本编辑器控件.功能就不用多说了吧,大家都经常用到的.DNN利用Providers模式可以很方便的集成多种富文本编辑器.据我所知就有:FreeTextBox,FCKEditor,WebHtmlEditor,CuteEditor.大家可以通过配置web.config就可以很容易的选择使用一种了,具体的配置方法在每一个富文本编辑器Providers中应该都有详细的说明. 位置:controls\T

DNN模块开发系列文章(1)——分析设计

序 DNN做为一个优秀的门户网站框架,可以通过安装各种功能模块的方式扩充应用.正是通过这一优秀的功能,DNN框架可以实现:文章管理,图片管理,文档管理,论坛,博客,商店,调查,FAQ等等各种各样满足实际需求的模块.通过这个强大的框架支持,我们可以很容易的实现这些模块.比如:权限控制,多语言支持,多数据库支持,搜索,聚合,皮肤等功能,我都可以很容易的通过框架实现.如果是在平时,光是实现这些基础功能我们就需要花去大量的时间.现在有了DNN框架的支持,我们就可以集中精力投入到模块的业务逻辑和流程上,从

Asp.net MVC2.0系列文章-显示列表和详细页面操作

上一篇文章,我们简单地完成了新闻的添加操作(Asp.net MVC2.0系列文章-添 加操作)此篇文章,我们使用Asp.net MVC2.0实现新闻清单的展示和新闻详细页面 . 创建View视图Index和NewsDetails 创建新闻首页,用来显示新闻列表. 在Views/News目录下,单击右键,选择Add->View,修改相关配置如下图所 示 在生成的HTML代码中,进行相关展示方面的修改.主要代码如下: <% foreach (var item in Model) { %> &

设计模式(C#)系列文章索引

介绍 类图加实例的方式介绍设计模式(C#) 创建型模式(Creational Pattern) 1.设计模式(C#) - 抽象工厂模式(Abstract Factory Pattern) 介绍 提供一个创建一系列相关或相互依赖对象的接口,而无需指定它们具体的类. 2.设计模式(C#) - 建造者模式(Builder Pattern) 介绍 将一个复杂对象的构建与它的表示分离,使得同样的构建过程可以创建不同的表示. 3.设计模式(C#) - 原型模式(Prototype Pattern) 介绍 用

[Android] 图像各种处理系列文章合集

    这是我最近在做Android随手拍一个项目的各种网上关于图片处理的资料,以前学过数字图像处理都是用C++写的,下面的资料个人认为是非常优秀的各种集合,另一方面它是在线笔记,希望对大家有所帮助吧!其中我截图部分都是作者经典的文章显示效果.    1.<android图片处理总结>作者邮箱可能是jacpy.may@gmail.com,同时sjf0115转载很多文章,非常优秀的一本短书.感谢作者和博主sjf0115(落日小屋).        android图像处理系列之三--图片色调饱和度