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,字符:字符是抽象的最小文本单位.它没有固定的形状(可能是一个字形),而且没有值." ...
随机推荐
- 重装Ubuntu系统并配置开发环境
安装 Ubuntu 并配置开发环境 写一篇文章详细记录下来所有的过程,以便以后参考. 安装前的准备 备份所有代码和配置文件 备份下载的各类文件 Ubuntu 安装 下载安装 Ubuntu14.04,下 ...
- IOS网络编程:HTTP
IOS网络编程:HTTP HTTP定义了一种在服务器和客户端之间传递数据的途径. URL定义了一种唯一标示资源在网络中位置的途径. REQUESTS 和 RESPONSES: 客户端先建立一个TCP连 ...
- Expert Shell Scripting
Expert Shell Scripting 好好学习这本书
- js 返回前一页并刷新页面方法
[导读] 要返回上一页再刷新页面我们用到最多的是在像php,asp,jsp,asp.net中,下面我来给大家先介绍js 返回前一页并刷新页面,然后再把这些代码放在php中实现删除后返回当前页面并刷新页 ...
- BZOJ 1012 最大数
Description 现在请求你维护一个数列,要求提供以下两种操作: 1. 查询操作.语法:Q L 功能:查询当前数列中末尾L个数中的最大的数,并输出这个数的值.限制:L不超过当前数列的长度. 2. ...
- SharePoint ListTemplateType enumeration
from microsoft http://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.client.listtempla ...
- codeforces C. Sereja and Swaps
http://codeforces.com/contest/426/problem/C 题意:找出连续序列的和的最大值,可以允许交换k次任意位置的两个数. 思路:枚举区间,依次把区间内的比较小的数换成 ...
- Caption,Text,WindowText的区别——TControl也有FText,是为了模拟一个窗口
TControl = class(TComponent) // 控件的Windows功能从TControl开始 property Caption: TCaption read GetText writ ...
- Timus1132(二次剩余方程求解)
题目:http://acm.timus.ru/problem.aspx?space=1&num=1132 题意:就是给出方程,p为素数,求在区间内的解. 这个思路很简单,详见:http://a ...
- Function语义学之member function
之前我们讲过编译器会对 nonmember functions 进行怎样的扩充和该写,今天我们来讲一下 member functions 函数调用方式 一.Nonstatic Member Funct ...