随笔分类 -  C#

摘要:Why are C# 4 optional parameters defined on interface not enforced on implementing class? UPDATE: This question was the subject of my blog on May 12th 阅读全文
posted @ 2020-06-02 16:40 ChuckLu 阅读(129) 评论(0) 推荐(0) 编辑
摘要:Why use a public method in an internal class? UPDATE: This question was the subject of my blog in September 2014. Thanks for the great question! There 阅读全文
posted @ 2020-06-02 15:40 ChuckLu 阅读(214) 评论(0) 推荐(0) 编辑
摘要:cannot implicitly convert type 'bool?' to 'bool'. An explicit conversion exists (are you missing a cast?) As the others stated bool? is not equal to b 阅读全文
posted @ 2020-05-08 11:28 ChuckLu 阅读(915) 评论(0) 推荐(0) 编辑
摘要:System.IO.FileLoadException: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one o 阅读全文
posted @ 2020-04-14 15:55 ChuckLu 阅读(1240) 评论(0) 推荐(0) 编辑
摘要:Does Dispose still get called when exception is thrown inside of a using statement? Yes, using wraps your code in a try/finally block where the finall 阅读全文
posted @ 2020-04-02 10:41 ChuckLu 阅读(126) 评论(0) 推荐(0) 编辑
摘要:Why use a public method in an internal class? UPDATE: This question was the subject of my blog in September 2014. Thanks for the great question! There 阅读全文
posted @ 2020-03-31 16:11 ChuckLu 阅读(172) 评论(0) 推荐(0) 编辑
摘要:Why can two different enum enumeration-constants have the same integer value? C enums are "really" integers -- not just because they happen to be impl 阅读全文
posted @ 2020-03-28 22:09 ChuckLu 阅读(143) 评论(0) 推荐(0) 编辑
摘要:http://www.codewars.com/kata/56676e8fabd2d1ff3000000c/train/csharp Can you find the needle in the haystack? Write a function findNeedle() that takes a 阅读全文
posted @ 2020-03-23 18:17 ChuckLu 阅读(530) 评论(0) 推荐(0) 编辑
摘要:打开dll的源码,然后attach到那个加载了反射dll的进程上。 就可以调试dll的代码 阅读全文
posted @ 2020-03-10 18:34 ChuckLu 阅读(426) 评论(0) 推荐(0) 编辑
摘要:Why you need to understand garbage collection I’ve been interviewing lots of C# developers recently, and one of my stock questions is “how does the .N 阅读全文
posted @ 2019-12-12 10:22 ChuckLu 阅读(188) 评论(1) 推荐(0) 编辑
摘要:这个错误,在使用List<T>的First函数遇到。 Sequence contains no elements? From "Fixing LINQ Error: Sequence contains no elements": When you get the LINQ error "Sequen 阅读全文
posted @ 2019-10-22 11:27 ChuckLu 阅读(10273) 评论(0) 推荐(0) 编辑
摘要:Check if List<Int32> values are consecutive One-liner, only iterates until the first non-consecutive element: bool isConsecutive = !myIntList.Select(( 阅读全文
posted @ 2019-10-21 15:14 ChuckLu 阅读(159) 评论(0) 推荐(0) 编辑
摘要:Why would I want to use an ExpressionVisitor? There was a issue where on the database we had fields which contained 0 or 1 (numeric), and we wanted to 阅读全文
posted @ 2019-09-24 19:05 ChuckLu 阅读(226) 评论(0) 推荐(0) 编辑
摘要:Interpreting Expressions 阅读全文
posted @ 2019-09-24 18:57 ChuckLu 阅读(146) 评论(0) 推荐(0) 编辑
摘要:Traverse an expression tree and extract parameters I think as you've said that using ExpressionVisitor works out to be a good approach. You don't need 阅读全文
posted @ 2019-09-24 18:56 ChuckLu 阅读(341) 评论(0) 推荐(0) 编辑
摘要:Get Argument Values From Linq Expression If you even find yourself unpacking an expression in C#, you might find this useful. I found myself in need o 阅读全文
posted @ 2019-09-24 18:45 ChuckLu 阅读(206) 评论(0) 推荐(0) 编辑
摘要:Like anonymous methods, iterators in C# are very complex syntactic sugar. You could do it all yourself (after all, you did have to do it all yourself 阅读全文
posted @ 2019-09-18 14:36 ChuckLu 阅读(226) 评论(0) 推荐(0) 编辑
摘要:What is the use of c# “Yield” keyword ? “Yield keyword helps us to do custom stateful iteration over .NET collections.” There are two scenarios where 阅读全文
posted @ 2019-09-18 14:34 ChuckLu 阅读(151) 评论(0) 推荐(0) 编辑
摘要:What is the yield keyword used for in C#? 回答1 The yield keyword actually does quite a lot here. The function returns an object that implements the IEn 阅读全文
posted @ 2019-09-18 14:31 ChuckLu 阅读(223) 评论(0) 推荐(0) 编辑
摘要:https://en.wikipedia.org/wiki/Coroutine Coroutines are computer program components that generalize subroutines for non-preemptive multitasking, by all 阅读全文
posted @ 2019-09-18 13:56 ChuckLu 阅读(376) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示