MiniExcel/drafts/【LINQ】Deferred Execution.linq
wei 3c6d2cdeb4 drafts\【JsonNET】JObject multi level.linq
drafts\【LINQ】Deferred Execution.linq
drafts\【MiniExcel】SaveByTemplate.linq
drafts\【MiniExcel】multi level properties get value.linq
drafts\【Reader】SQL ExecuteReader won't stop running immediately.linq
drafts\【Reflection】PropertyType vs ReflectedType vs DeclaringType vs MemberType.linq
2021-04-02 21:53:48 +08:00

43 lines
1.2 KiB
C#

<Query Kind="Program">
<NuGetReference>Dapper</NuGetReference>
<NuGetReference>MiniExcel</NuGetReference>
<NuGetReference>Newtonsoft.Json</NuGetReference>
<NuGetReference>System.Data.SqlClient</NuGetReference>
<Namespace>Dapper</Namespace>
<Namespace>MiniExcelLibs</Namespace>
<Namespace>Newtonsoft.Json</Namespace>
<RemoveNamespace>System.Data</RemoveNamespace>
<RemoveNamespace>System.Diagnostics</RemoveNamespace>
<RemoveNamespace>System.Linq.Expressions</RemoveNamespace>
<RemoveNamespace>System.Text</RemoveNamespace>
<RemoveNamespace>System.Text.RegularExpressions</RemoveNamespace>
<RemoveNamespace>System.Threading</RemoveNamespace>
<RemoveNamespace>System.Transactions</RemoveNamespace>
<RemoveNamespace>System.Xml</RemoveNamespace>
<RemoveNamespace>System.Xml.Linq</RemoveNamespace>
<RemoveNamespace>System.Xml.XPath</RemoveNamespace>
</Query>
// 【LINQ】Deferred Execution
void Main()
{
var input = GetFooData();
{
var output = input.Skip(10).Take(5); //console output : 0..14
output.Count();
}
{
var output = input.ToList().Skip(10).Take(5); //console output : 0..99
output.Count();
}
}
IEnumerable<int> GetFooData()
{
for (int i = 0; i < 100; i++)
{
Console.WriteLine(i);
yield return i;
}
}