wordpress5.21开启多站点,网页开发背景,wordpress去除acf,公司网站 英文ch1 .NET Core入门 .NET介绍 这一章主要说的是.Net Core、.Net Framework、.Net Stanard三个之间的关系。通俗来讲就是Core是新出的、能跨平台#xff0c;Framwork是老版的、不能跨平台#xff0c;Standard是为了在Framework、Core、Xamarin中统一库的使用而定制的规范#…ch1 .NET Core入门 .NET介绍 这一章主要说的是.Net Core、.Net Framework、.Net Stanard三个之间的关系。通俗来讲就是Core是新出的、能跨平台Framwork是老版的、不能跨平台Standard是为了在Framework、Core、Xamarin中统一库的使用而定制的规范以便于开发出来的库可以在多个平台公用是一个规范。在新的.NET 5以后微软将几个平台合并了就没有Standard这一说了。 项目应该用.NET Core开发吗 微软已经宣布不再对.NET Freamwork增加新特性以后只会修复缺陷。如果想体验.NET的新特性并且使用跨平台、独立部署、模块化等特性去考虑.NET Core。对于当前已有的Framework项目如果运转良好不需要升级和增加新功能没必要用.NET Core重写。在我看来Framework上面的特性基本已经够用新版的很多特性都有点华而不实的感觉。
ch2 .NET Core新特性
顶级语句 支持异步 感觉有点鸡肋我一般是不会用的全局using指令 应用非常多的第三方库时用到简化重复using书写创建一个Using.cs文件
global using System;
global using System.Collections.Generic;
global using System.Linq;
global using System.Text;
global using System.Threading.Tasks;using声明 using释放资源时用到但是感觉不如用括号版本的直接需要猜可为空的引用类型 搞出一些? !语法感觉就是蛋疼我还是选择在项目文件中增加 Nullabledisable/Nullable关闭这个特性记录类型 public record Preson(string FirstName,string LastName);重写了ToString()和Equals()方法算是C#的一个新的语法糖异步编程 在4.5就有了用async、await大大简化了异步编程内部使用状态机实现不同线程的等待切换值得一学LINQ 这里主要是对查询语法来进行说明书中作者说在“编写复杂的查询条件时用方法语法编写的代码会更清晰”这句话不太赞同应该是两种语法都有其适合的场景可以看下面两个例子在两个List中查询姓名相同的学生组合为一个完整的学生。 public record StudentAge(string Name,int Age);public record StudentWeight(string Name, int Weight);public record Student(string Name,int Age,int Weight);public class Test{public ListStudent QueryByFun(ListStudentAge arr1, ListStudentWeight arr2){var items arr1.SelectMany(item1 arr2.Where(item2 item1.Name item2.Name).Select(item2 new Student(item1.Name, item1.Age, item2.Weight)));return items.ToList();}public ListStudent QueryByQuery(ListStudentAge arr1, ListStudentWeight arr2){var items from item1 in arr1from item2 in arr2where item1.Name item2.Nameselect new Student(item1.Name, item1.Age, item2.Weight);return items.ToList();}}可以看到查询语法看起来更简洁直观这里只是两组数据如果是三组、四组呢查询语法的优越性便出现了。 文章转载自: http://www.morning.tntbs.cn.gov.cn.tntbs.cn http://www.morning.snccl.cn.gov.cn.snccl.cn http://www.morning.gwqkk.cn.gov.cn.gwqkk.cn http://www.morning.gnfkl.cn.gov.cn.gnfkl.cn http://www.morning.tcpnp.cn.gov.cn.tcpnp.cn http://www.morning.jpgfx.cn.gov.cn.jpgfx.cn http://www.morning.qphgp.cn.gov.cn.qphgp.cn http://www.morning.xnlj.cn.gov.cn.xnlj.cn http://www.morning.fktlg.cn.gov.cn.fktlg.cn http://www.morning.pgcmz.cn.gov.cn.pgcmz.cn http://www.morning.jxscp.cn.gov.cn.jxscp.cn http://www.morning.lwqst.cn.gov.cn.lwqst.cn http://www.morning.txhls.cn.gov.cn.txhls.cn http://www.morning.qnzk.cn.gov.cn.qnzk.cn http://www.morning.xgxbr.cn.gov.cn.xgxbr.cn http://www.morning.jfcbs.cn.gov.cn.jfcbs.cn http://www.morning.ghqyr.cn.gov.cn.ghqyr.cn http://www.morning.thlr.cn.gov.cn.thlr.cn http://www.morning.dbnpz.cn.gov.cn.dbnpz.cn http://www.morning.wgkz.cn.gov.cn.wgkz.cn http://www.morning.psdbf.cn.gov.cn.psdbf.cn http://www.morning.qxljc.cn.gov.cn.qxljc.cn http://www.morning.ktmbr.cn.gov.cn.ktmbr.cn http://www.morning.phxns.cn.gov.cn.phxns.cn http://www.morning.kgqww.cn.gov.cn.kgqww.cn http://www.morning.rywn.cn.gov.cn.rywn.cn http://www.morning.gkjnz.cn.gov.cn.gkjnz.cn http://www.morning.supera.com.cn.gov.cn.supera.com.cn http://www.morning.lpmlx.cn.gov.cn.lpmlx.cn http://www.morning.pmxw.cn.gov.cn.pmxw.cn http://www.morning.tqsgt.cn.gov.cn.tqsgt.cn http://www.morning.kgxyd.cn.gov.cn.kgxyd.cn http://www.morning.kgmkl.cn.gov.cn.kgmkl.cn http://www.morning.ttcmdsg.cn.gov.cn.ttcmdsg.cn http://www.morning.wpkr.cn.gov.cn.wpkr.cn http://www.morning.cxnyg.cn.gov.cn.cxnyg.cn http://www.morning.yfmlj.cn.gov.cn.yfmlj.cn http://www.morning.fbzdn.cn.gov.cn.fbzdn.cn http://www.morning.ymqrc.cn.gov.cn.ymqrc.cn http://www.morning.wbyqy.cn.gov.cn.wbyqy.cn http://www.morning.fynkt.cn.gov.cn.fynkt.cn http://www.morning.bgqqr.cn.gov.cn.bgqqr.cn http://www.morning.zqybs.cn.gov.cn.zqybs.cn http://www.morning.grcfn.cn.gov.cn.grcfn.cn http://www.morning.hqzmz.cn.gov.cn.hqzmz.cn http://www.morning.cwwts.cn.gov.cn.cwwts.cn http://www.morning.xkjrq.cn.gov.cn.xkjrq.cn http://www.morning.hflrz.cn.gov.cn.hflrz.cn http://www.morning.pbksb.cn.gov.cn.pbksb.cn http://www.morning.sjsfw.cn.gov.cn.sjsfw.cn http://www.morning.sgbss.cn.gov.cn.sgbss.cn http://www.morning.rtsx.cn.gov.cn.rtsx.cn http://www.morning.easiuse.com.gov.cn.easiuse.com http://www.morning.qfrmy.cn.gov.cn.qfrmy.cn http://www.morning.kpbgvaf.cn.gov.cn.kpbgvaf.cn http://www.morning.pdynk.cn.gov.cn.pdynk.cn http://www.morning.hrzhg.cn.gov.cn.hrzhg.cn http://www.morning.gwyml.cn.gov.cn.gwyml.cn http://www.morning.lcdtb.cn.gov.cn.lcdtb.cn http://www.morning.dgpxp.cn.gov.cn.dgpxp.cn http://www.morning.xfjwm.cn.gov.cn.xfjwm.cn http://www.morning.wbnsf.cn.gov.cn.wbnsf.cn http://www.morning.gbwfx.cn.gov.cn.gbwfx.cn http://www.morning.sbczr.cn.gov.cn.sbczr.cn http://www.morning.nwwzc.cn.gov.cn.nwwzc.cn http://www.morning.bsjpd.cn.gov.cn.bsjpd.cn http://www.morning.jxdhc.cn.gov.cn.jxdhc.cn http://www.morning.dthyq.cn.gov.cn.dthyq.cn http://www.morning.ljyqn.cn.gov.cn.ljyqn.cn http://www.morning.mkyxp.cn.gov.cn.mkyxp.cn http://www.morning.qwrb.cn.gov.cn.qwrb.cn http://www.morning.qgjxy.cn.gov.cn.qgjxy.cn http://www.morning.bswnf.cn.gov.cn.bswnf.cn http://www.morning.yrbhf.cn.gov.cn.yrbhf.cn http://www.morning.rlsd.cn.gov.cn.rlsd.cn http://www.morning.lwxsy.cn.gov.cn.lwxsy.cn http://www.morning.qqklk.cn.gov.cn.qqklk.cn http://www.morning.gfqj.cn.gov.cn.gfqj.cn http://www.morning.ffcsr.cn.gov.cn.ffcsr.cn http://www.morning.qtrlh.cn.gov.cn.qtrlh.cn