博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
New Features in C# 3.0, 4.0 and 5.0 (英文差的免入)
阅读量:5865 次
发布时间:2019-06-19

本文共 2188 字,大约阅读时间需要 7 分钟。

What’s New in C# 3.0

  Language Integrated Query(LINQ)

   - LINQ enables queries to be written in C# program to query both local collections

      (such as lists or XML documents) or remote data sources (such as a database)

  Implicitly typed local variables

   -  let you omit the variable type in a declaration statement, allowing the compiler to infer it

 Object initializers

   - simplify object construction by allowing properties to be set inline after the constructor call

 Lambda expressions

   - miniature functions created by the compiler on the fly, and are particularly useful in “fluent” LINQ queries

 Extension methods

   - extend an existing type with new methods, making static methods feel like instance methods

 Query expressions

   - provide a higher-level syntax for writing LINQ queries that can be substantially simpler when working

      with multiple sequences or range

       variables

  Expression trees

    - miniature code DOMs that describe lambda expressions assigned to the

       special type Expression<TDelegate>

       Expression trees make it possible for LINQ queries to execute remotely

   Automatic properties

    - cut the work in writing properties that simply get/set a private backing field by having the compiler do that work automatically 

  Partial methods

    - let an auto-generated partial class provide customizable hooks for manual authoring which “melt away” if unused

 

What’s New in C# 4.0

   Dynamic binding

     - defers binding

    Optional parameters

     - allow functions to specify default parameter values so that callers can omit arguments and named arguments

       allow a function caller to identify an argument by name rather than position

   Type variance rules

     - type parameters in generic interfaces and generic delegates can be marked as covariant or

        contravariant, allowing more natural type conversions

   COM interoperability

 

What’s New in C# 5.0

  C# 5.0’s big new feature is support for asynchronous functions via two new

  keywords, async and await. Asynchronous functions enable asynchronous continuations,
  which make it easier to write responsive and thread-safe rich-client applications.
  They also make it easy to write highly concurrent and efficient I/O-bound
  applications that don’t tie up a thread resource per operation

 

 

 

转载地址:http://uiynx.baihongyu.com/

你可能感兴趣的文章
雅虎遗留的“阿里他爸”身价涨到600亿美元 马云有钱回购吗?
查看>>
台北光伏电站太阳能电池板疑过热自燃 详因待查明
查看>>
在阿里云容器服务上,轻松搭建Concourse CI
查看>>
移动互联网的下一个红海将会在物联网时代下爆发
查看>>
大数据量化用户体验
查看>>
OpenStack巨头Mirantis2015年业务增长了四倍
查看>>
光纤计算题:Pure + 思科 = 端到端NVMe
查看>>
一百天,一场修行,要不试试?
查看>>
微软确认裁员300多人,主要波及雷德蒙德总部
查看>>
这些东西别晒到朋 友 圈,小心惹来祸!
查看>>
抢占智能家居“风口”
查看>>
微软收购一款以游戏形式学习的工具MinecraftEdu
查看>>
微软为顺利收购LinkedIn对欧盟做出让步
查看>>
为什么OCP服务器在一般性的IT企业难以普及
查看>>
用什么方法预防黑客对家庭网络的入侵?
查看>>
WannaCry病毒爆发并未对微软品牌造成太大影响
查看>>
武汉将打造中国网络安全谷 亿元招募全球顶尖人才
查看>>
企业组织与IT供应商的谈判指南
查看>>
5亿用户信息两年前被盗!雅虎为何现在才说?
查看>>
Openvox 模拟语音卡/FXS-100
查看>>