zoukankan      html  css  js  c++  java
  • What's New in the C# 3.0 Language and Compiler

    The C# 3.0 language and compiler introduce several new language features. These new language constructs are useful individually in various contexts, and collectively for doing Language-Integrated Query (LINQ). For more information about LINQ, see The LINQ Pro.

    Note

    The September 2006 Community Technology Preview version of the C# compiler and Visual C# IDE do not fully implement or support the C# 3.0 language specification. Error messages and IntelliSense™ support, even for implemented language features, are not yet complete. Therefore, to create LINQ projects you should use the May 2006 LINQ which includes a prototype version of the new compiler.

    The following table lists the new C# 3.0 language features:

    Feature

    Description

    Present in September 2006 CTP

    Implicitly Typed Local Variables (C# Programming Guide)

    When used with local variables, the var keyword instructs the compiler to infer the type of the variable from the expression on the right side of the initialization statement.

    Yes

    Object Initializers (C# Programming Guide)

    Enables object initialization without explicit calls to a constructor.

    Yes

    Collection Initializers (C# Programming Guide)

    Enables initialization of collections with an initialization list rather than specific calls to "Add" or another method.

    Partially

    Implicitly Typed Arrays (C# Programming Guide)

    Enables the type of the array instance to be inferred from the elements specified in the array initializer.

    No

    Extension Methods (C# Programming Guide)

    Extend existing classes with static methods that can be invoked by using instance method syntax.

    Partially

    Anonymous Types (C# Programming Guide)

    Enables on-the-fly creation of unnamed structured types that can be added to collections and accessed using var.

    No

    Lambdas (C# Programming Guide)

    Enables inline expressions with input parameters that can be bound to delegates or expression trees.

    Partially

    Query Keywords (C# Reference)

    Keywords that specify clauses in a query expression:

    • from clause(s)
    • where clause (optional)
    • ordering clauses (optional)
    • ordering direction clause (optional)
    • select or group clause
    • into clause (optional)

    Partially

    ms-help://MS.MSDNQTR.v90.en/MS.MSDN.v90/MS.VisualStudio.v90.en/dv_cscon/html/e5193336-6adb-471e-ab22-e3fc60e0fa52.htm

    以上文字来自 MSDN Library for Visual Studio Codename Orcas.

    本想弄个实际一点的代码来着。后来想想水平有限,时间有限就别丢人了J

  • 相关阅读:
    18 | 案例篇:内存泄漏了,我该如何定位和处理?
    17 | 案例篇:如何利用系统缓存优化程序的运行效率?
    16 | 基础篇:怎么理解内存中的Buffer和Cache?
    Scrapyd 改进第一步: Web Interface 添加 charset=UTF-8, 避免查看 log 出现中文乱码
    scrapy_redis 相关: 将 jobdir 保存的爬虫进度转移到 Redis
    lxml.etree.HTML(text) 解析HTML文档
    CSS/Xpath 选择器 第几个子节点/父节点/兄弟节点
    scrapy_redis 相关: 查看保存的数据
    scrapy 通过FormRequest模拟登录再继续
    python2 python3 转换,兼容
  • 原文地址:https://www.cnblogs.com/yanlixin/p/632541.html
Copyright © 2011-2022 走看看