????4?????ж?
???????ж????????????C#6?????????????????????????
//????????????????????ú????
Post post = null;
string title = "";
if (post != null)
{
title = post.Title;
}
//C#6????????????????ж?
title = post?.Title;
??????????ж??????????????????????????????????????????????????????ж????????ж??????????
Post post = null;
List posts = null;
if (posts != null)
{
post = posts[0];
}
//????????????????????????????????
post = posts?[0];
????5??getter-only ???????
???????????????????????????????????????????????????????????????????????????????
public class Post
{
public int Votes{get;private set;}
}
//??????????????
public class Post
{
public int Votes{get;}
}
????6?????????????
?????????Expression Bodied Members?????????????Lambda??????????????????
public class Post
{
public int AddOld()
{
return 1 + 1;
}
//???????????Lambda????????
public int AddNew() => 1+1;
}
????7????static using?????t????????
???????????????????????????????????????????????????????????????????????????????????????using static XXX????????????????????? ??????????д?????????????????????????????
???????
???????е?string???????ж???????????????????????????????????????   ???????????úe?ASP.NET Core????????????.net?????????