惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
C
Cisco Blogs
Help Net Security
Help Net Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Scott Helme
Scott Helme
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
M
MIT News - Artificial intelligence
L
LINUX DO - 热门话题
I
InfoQ
GbyAI
GbyAI
NISL@THU
NISL@THU
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Engineering at Meta
Engineering at Meta
H
Hackread – Cybersecurity News, Data Breaches, AI and More
TaoSecurity Blog
TaoSecurity Blog
Simon Willison's Weblog
Simon Willison's Weblog
A
About on SuperTechFans
Spread Privacy
Spread Privacy
月光博客
月光博客
W
WeLiveSecurity
AWS News Blog
AWS News Blog
云风的 BLOG
云风的 BLOG
有赞技术团队
有赞技术团队
Security Latest
Security Latest
人人都是产品经理
人人都是产品经理
PCI Perspectives
PCI Perspectives
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - Blog
S
SegmentFault 最新的问题
T
Troy Hunt's Blog
Martin Fowler
Martin Fowler
The Hacker News
The Hacker News
T
Tor Project blog
C
CERT Recently Published Vulnerability Notes
Apple Machine Learning Research
Apple Machine Learning Research
Stack Overflow Blog
Stack Overflow Blog
K
Kaspersky official blog
Cloudbric
Cloudbric
H
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tailwind CSS Blog
D
DataBreaches.Net
Security Archives - TechRepublic
Security Archives - TechRepublic
T
Tenable Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - Franky
L
LINUX DO - 最新话题
MyScale Blog
MyScale Blog

博客园 - sinlight23

Web开发框架趋势 ASP.NET MVC - PageData的应用 ASP.NET拾遗 - Health Monitoring .NET Xml序列化时会忽略值为"默认值"的Property或Field ASP.NET MVC 实现模式 - ModelBuilder HOWTO: Web Deploy时服务器报登录失败的解决方法 HOWTO: 为GitHub for Windows指定代理服务器 ASP.NET MVC - 在MVC 3项目中使用ASP.NET Bundling and Minification机制 脚印:关于错误编码的管理的一些思考 脚印:软件开发随想录 脚印:关于扩展方法的使用 脚印:一次重构讨论 脚印:记录一次重构,将规则生产和规则消费(执行委托)分离 HOWTO: IE8下处理iframe自适应高度 Microsoft ASP.NET 2.0 AJAX 相关信息备忘 MVC 模式在javascript中的应用 VS2010 "SQL Server 2005 Database Project" 使用笔记(二) VS2010 "SQL Server 2005 Database Project" 使用笔记 腳印: 初學者的心態
Enumerable.Range和自定义的IntRange/DateRange
sinlight23 · 2013-02-08 · via 博客园 - sinlight23

今天,查资料的时候无意中发现早在v3.5,.NET Fx就提供了Enumerable.Range这个方法,用来生成指定范围的,连续的整数集合。

为什么提起这个

记得之前,是看RubyCoffeeScript中,在语法层面做了类似的事:[1..5], 然后某天写一段C#代码的时候,忽然也想要这个便利。

需求是这样的:
from i in new IntRange(1, personCount)
select new CustomerModel();

于是便中断工作,停下来写了这个,顺便还写了个DateRange和一些单元测试。