Linq101-Miscellaneous
using System;
using System.Collections.Generic;
using System.Linq; namespace Linq101
{
class Miscellaneous
{
/// <summary>
/// This sample uses Concat to create one sequence that contains each array's values, one after the other.
/// </summary>
public void Linq94()
{
int[] numbersA = { , , , , , , };
int[] numbersB = { , , , , }; var allNumbers = numbersA.Concat(numbersB); Console.WriteLine("All numbers from both arrays:"); foreach (int number in allNumbers)
{
Console.WriteLine(number);
}
} /// <summary>
/// This sample uses Concat to create one sequence that contains the names of all customers and products, including any duplicates.
/// </summary>
public void Linq95()
{
List<Data.Customer> customers = Data.GetCustomerList();
List<Data.Product> products = Data.GetProductList(); var customerNames = from c in customers
select c.CompanyName;
var productNames = from p in products
select p.ProductName; var allNames = customerNames.Concat(productNames); Console.WriteLine("Customer and product names:"); foreach (string name in allNames)
{
Console.WriteLine(name);
}
} /// <summary>
/// This sample uses EqualAll to see if two sequences match on all elements in the same order.
/// </summary>
public void Linq96()
{
var wordsA = new[] { "cherry", "apple", "blueberry" };
var wordsB = new[] { "cherry", "apple", "blueberry" }; bool match = wordsA.SequenceEqual(wordsB); Console.WriteLine("The sequences match :{0}", match);
} /// <summary>
/// This sample uses EqualAll to see if two sequences match on all elements in the same order.
/// </summary>
public void Linq97()
{
var wordsA = new[] { "cherry", "apple", "blueberry" };
var wordsB = new[] { "apple", "blueberry", "cherry" }; bool match = wordsA.SequenceEqual(wordsB); Console.WriteLine("The sequences match: {0}", match);
}
}
}
Linq101-Miscellaneous的更多相关文章
- 小白日记46:kali渗透测试之Web渗透-SqlMap自动注入(四)-sqlmap参数详解- Enumeration,Brute force,UDF injection,File system,OS,Windows Registry,General,Miscellaneous
sqlmap自动注入 Enumeration[数据枚举] --privileges -U username[CU 当前账号] -D dvwa -T users -C user --columns [ ...
- Chapter 13. Miscellaneous PerlTk Methods PerlTk 方法杂项:
Chapter 13. Miscellaneous PerlTk Methods PerlTk 方法杂项: 到目前为止,这本书的大部分章节 集中在特定的几个部件, 这个章节覆盖了方法和子程序 可以被任 ...
- Miscellaneous Articles
标记一下,慢慢看 http://www.oracle-base.com/articles/misc/articles-misc.php Miscellaneous Articles DBA Deve ...
- Sass函数-Miscellaneous函数(三元条件函数)
在这里把 Miscellaneous 函数称为三元条件函数,主要因为他和 JavaScript 中的三元判断非常的相似.他有两个值,当条件成立返回一种值,当条件不成立时返回另一种值: if($cond ...
- Quartz Tutorial 11 - Miscellaneous Features of Quartz
文章目录 Plug-Ins Quartz提供了一个接口(org.quartz.spi.SchedulerPlugin) 用于插入附加的功能. 与Quartz一同发布的,提供了各种实用功能的插件可以在o ...
- MinkowskiEngine Miscellaneous Classes杂类
Miscellaneous Classes杂类 内核生成器 class MinkowskiEngine.KernelGenerator(kernel_size = -1,stride = 1,dila ...
- Confluence 6 数据库表-杂项(Miscellaneous)
这些部分是一些其他的表格,这些表格有必要在这里提及下能帮你更好的了解系统. os_propertyentry 有关实体和属性相关的特性. bandana 所有的持久层.这个表格包含的的内容有用户设置和 ...
- Loadrunder脚本篇——Run-time Settings之Miscellaneous
作用说明 提供混杂设置,如错误处理,多线程,自动化事务设置等 注意:仅对指定协议有效 Error Handling Continue on Error 开启后,在VuGen中,如脚本中某个函数出错 ...
- uvm_misc——杂货铺(miscellaneous)
uvm_misc 是个很有意思的文件夹,本质上就是个UVM的杂货铺,包含一些很重要的class, task, function, 但不知道给归类到哪儿,所以,uvm_misc就很好地承担了这个任务,几 ...
- 【miscellaneous】【C/C++语言】UTF8与GBK字符编码之间的相互转换
UTF8与GBK字符编码之间的相互转换 C++ UTF8编码转换 CChineseCode 一 预备知识 1,字符:字符是抽象的最小文本单位.它没有固定的形状(可能是一个字形),而且没有值." ...
随机推荐
- thinkphp3.2.2前后台公用类架构问题
3.13之前好多项目都使用前后台公用类,在lib/action下创建Baseaction做为公共继承类,发现3.2.2里面很多人都用A调用,这样每用一次要用A调用,好麻烦,小编特意偷懒.亲测使用以下方 ...
- Spring MVC 教程,快速入门,深入分析(转载)
作者:赵磊 博客:http://elf8848.iteye.com 下载: Spring的官方下载网址是:http://www.springsource.org/download (本文使用是的 ...
- Jersey Politics
poj2454:http://poj.org/problem?id=2454 题意:给你3*k个数,然后让你分成三堆,使得至少其中的两堆中的数字之和大于500*k.题解:这道题一开始我并不知道怎么做, ...
- Tautology
WFF 'N PROOF is a logic game played with dice. Each die has six faces representing some subset of th ...
- 【效率】FIND
文档 HTML Flash CSS 字体 命名颜色 工具 IMG
- 【转】Any way to implement BLE notifications in Android-L preview----不错
原文网址:http://stackoverflow.com/questions/24865120/any-way-to-implement-ble-notifications-in-android-l ...
- Binary Tree Inorder Traversal ——LeetCode
Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tre ...
- 我的学习笔记之node----node.js+socket.io实时聊天(1) (谨此纪念博客开篇)
本想着从hello word开篇,也确实写了相关学习笔记.各种原因吧,现在又着急写出作品,便作罢. 这里将记录一个node.js+socket.io的实时聊天程序.(当然我也是跟着网上各种教程资料学习 ...
- 吐槽iOS国际化:关于NSLocalizedString的使用
http://blog.csdn.net/aries4ever/article/details/8185405
- 配置Chrome启动参数支持本地AJAX请求,解决XMLHttpRequest cannot load file..,Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest':.. 问题
直接将本地的HTML文件拖拽到Chrome浏览器中运行时,发送的AJAX请求本地文件,会报跨域错误: 报错的原因是:Chrome默认不支持本地的AJAX请求! 解决问题的办法是:给Chrome浏览器添 ...