随笔分类 - 技术目录十[C#]
摘要:public static String Format(String format, Object arg0) { Contract.Ensures(Contract.Result<String>() != null); return FormatHelper(null, format, new P
阅读全文
摘要:[System.Security.SecuritySafeCritical] // auto-generated unsafe public static String Copy (String str) { if (str==null) { throw new ArgumentNullExcept
阅读全文
摘要:public static String Concat(params Object[] args) { if (args==null) { throw new ArgumentNullException("args"); } Contract.Ensures(Contract.Result<Stri
阅读全文
摘要:[Pure] [System.Security.SecuritySafeCritical] // auto-generated public static bool Equals(String a, String b, StringComparison comparisonType) { if (c
阅读全文
摘要:案列: public class Animal { } public class Dog : Animal { } class Program { static void Main(string[] args) { Animal dog = new Dog(); Dog dog1 = new Dog
阅读全文
摘要:Lookup<TKey,TElement> 类 定义 命名空间:System.Linq程序集:netstandard.dll 表示键的集合,其中每个键映射到一个或多个值。 public class Lookup<TKey,TElement> : System.Collections.Generic.
阅读全文
摘要:源码: public static IEnumerable<TSource> Intersect<TSource>(this IEnumerable<TSource> first, IEnumerable<TSource> second) { if (first == null) throw Err
阅读全文
摘要:C#语法特性总结 转载自:C#语法特性总结 - louzi - 博客园 (cnblogs.com) C# 10已与.NET 6、VS2022一起发布,本文按照.NET的发布顺序,根据微软官方文档整理C#中一些有趣的语法特性。 注:基于不同.NET平台创建的项目,默认支持的C#版本是不一样的。下面介绍
阅读全文
摘要:首先看下源码: // Joins an array of strings together as one string with a separator between each original string. // [System.Security.SecuritySafeCritical] /
阅读全文
摘要:public static IEnumerable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector) { return
阅读全文
摘要:源码: public static TSource First<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate) { if (source == null) throw Error.ArgumentNu
阅读全文
摘要:源码: public static IEnumerable<TSource> Except<TSource>(this IEnumerable<TSource> first, IEnumerable<TSource> second) { if (first == null) throw Error.
阅读全文
摘要:源码: public static IEnumerable<TSource> Distinct<TSource>(this IEnumerable<TSource> source) { if (source == null) throw Error.ArgumentNull("source"); r
阅读全文
摘要:public class People { private string _Name = "小明"; public string Name { get { return _Name; } set { _Name = value; } } private int _Age = 15; public i
阅读全文
摘要:源码: public static IEnumerable<TResult> Empty<TResult>() { return EmptyEnumerable<TResult>.Instance; } // // We have added some optimization in SZArray
阅读全文
摘要:源码: public static TSource ElementAt<TSource>(this IEnumerable<TSource> source, int index) { if (source == null) throw Error.ArgumentNull("source"); IL
阅读全文
摘要:源码: public static IEnumerable<TSource> Distinct<TSource>(this IEnumerable<TSource> source) { if (source == null) throw Error.ArgumentNull("source"); r
阅读全文
摘要:源码: public static IEnumerable<TSource> DefaultIfEmpty<TSource>(this IEnumerable<TSource> source) { return DefaultIfEmpty(source, default(TSource)); }
阅读全文
摘要:分析一个Microsoft Docs文档案例: 地址:ICollection<T> 接口 (System.Collections.Generic) | Microsoft Docs using System; using System.Collections; using System.Collec
阅读全文
摘要:源码: public static int Count<TSource>(this IEnumerable<TSource> source) { if (source == null) throw Error.ArgumentNull("source"); ICollection<TSource>
阅读全文