Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
C# Null 传播运算符/条件访问表达式和 if 块
The 空传播运算符 条件访问表达式 https roslyn codeplex com discussions 540883进来c 6 0 questions tagged c 23 6 0看起来是一个非常方便的功能 但我很好奇它是否有助
c
null
languagefeatures
c60
.net Framework 4 中的 nameof 表达式
Visual Studio 2015 和 c 6 中引入了 nameof 表达式 nameof C 和 Visual Basic 参考 https msdn microsoft com en us library dn986596 28v
c
c60
nameof
如何将 C# 6 与网站项目类型一起使用?
更新了现有的Web Site项目类型Visual Studio 2015 我将Framework更改为4 6 然后我希望在我的代码隐藏文件中可以使用所有这些新功能 不幸的是我收到如下错误 错误 CS8026 功能 表达式主体属性 在 C 5
c
aspnet
VisualStudio
visualstudio2015
c60
如果 Exception 过滤器的过滤器抛出异常会发生什么
我还没有在 C 6 中工作过 但想知道 正如标题所说 如果Exception过滤器的过滤器抛出异常会发生什么 我想真正的答案是 过滤器应该以永远不会抛出异常的方式编写 但我们可以说它确实如此 异常是否会发生在 catch 本身内部 try
c
c60
在 ASP.NET 5 中动态加载程序集
我曾经有一些代码可以扫描bin我的应用程序的目录中包含尚未加载到 AppDomain 中并加载它们的程序集 它基本上看起来像 foreach var assemblyPath in Directory GetFiles path to bi
c
ASPNETCore
c60
nameof 和 typeof 的区别
如果我错了请纠正我 但是做类似的事情 var typeOfName typeof Foo Name and var nameOfName nameof Foo 应该给你完全相同的输出 根据该消息来源 可以理解的原因之一是 https msd
c
builtin
typeof
c60
nameof
C#6 中的长字符串插值行不支持 Tab、CR 和 LF
我尝试在 C 6 中使用制表符进行字符串插值 var name My Name var text t t name 它工作正常 制表符 t 已解决 当尝试使用时长字符串插值线 https stackoverflow com question
c
c60
stringinterpolation
强制 Microsoft Build Tools 2015 包含框架目标版本的 mscorlib,而不是 4.6
我在 Visual Studio 2015 中编写了一个应用程序 它使用 C 6 0 功能并面向 NET 4 5 2 当我使用 Microsoft Build Tools 2015 构建它时 这是由我们的 TeamCity 服务器完成的 生
c
MSBuild
c60
mscorlib
net452
为什么 C# 6 中声明表达式被删除?
在 C 6 的预览中 Microsoft 引入了用于声明内联参数的语法糖 如本文所示 http odetocode com blogs scott archive 2014 09 15 c 6 0 features part 3 decla
c60
在调试器中跳过表达式主体属性
有没有类似的 DebuggerStepThrough 属性可用于 C 中的表达式主体属性 例如我想跳过代码 public Byte ByteArray gt Builder CreateArray DebuggerStepThrough 不
c
c60
如何在 C# 6.0 中实现 INotifyPropertyChanged?
答案是这个问题 https stackoverflow com questions 1315621 implementing inotifypropertychanged does a better way exist 1316417 13
c
inotifypropertychanged
c50
c60
使用字符串插值内的变量指定小数位
我有一个字符串格式 其中包含两个整数变量 每个变量都需要格式化为可变长度 int x 1234 int y 42 Simplified real values come from method outputs so must use the
c
stringinterpolation
c60
.NET Core IHttpContextAccessor 问题
我有静态助手类 public static class Current public static string Host get return httpContextAccessor here 如何访问 Host 属性中的当前 HttpC
c
ASPNETCore
aspnetcoremvc
NetCore
c60
lambda 表达式中的枚举的编译方式不同;重载解析改进的结果是什么?
在尝试 Visual Studio 2015 RC 时 我收到了先前工作代码的运行时错误 给定 lambda x gt x CustomerStatusID CustomerStatuses Active 它被传递给一个函数作为Expres
c
Lambda
enums
roslyn
c60
使用字符串插值将字符串格式化为列
我需要打印双精度数 以便为值的字符串表示分配一定数量的符号 例如 8 接下来的单词应该从每个字符串中的字符串开头的相同索引处开始 我现在有 value 0 test value 0 3333333333333 test value 0 5
c
string
format
double
c60
VS 2015 中字符串插值的最终格式是什么?
我无法让字符串插值工作 我发现的来自微软的最新消息是 http blogs msdn com b csharpfaq archive 2014 11 20 new features in c 6 aspx http blogs msdn c
c
stringinterpolation
c60
C# 6 Elvis 运算符(空传播)是否短路
为什么这段 C 代码会抛出 null 异常 bool boolResult SomeClass NullableProperty ItsOkProperty false 一旦 NullableProperty 求值为 null elvis
c60
仅具有 getter 的自动化属性可以设置,为什么?
我创建了一个自动化属性 public int Foo get 这只是吸气剂 但是当我构建构造函数时 我可以更改该值 public MyClass string name Foo 5 为什么这是可能的 即使这是仅获取的 这是一个新的 C 6
c
c60
具有字符串插值的重载字符串方法
为什么字符串插值更喜欢重载方法string代替IFormattable 想象一下如下 static class Log static void Debug string message static void Debug IFormatta
c
c60
stringinterpolation
C# 6.0 空传播运算符和属性赋值
为了彻底解释这个问题已经被彻底修改 我注意到 C 6 0 中的 null 传播运算符似乎有一个相当糟糕的限制 因为您无法调用属性setters针对已传播 null 的对象 尽管您可以调用属性getters针对已传播 null 的对象 正如您
c
c60
nullpropagationoperator
1
2
3
»