方案之一(vs2015)
找到文件夹具:C:Program Files (x86)Microsoft Visual Studio 14.0Common7IDEItemTemplatesCacheCSharpData2052DbCtxCSEF6CSharpDbContext.Types.tt
[Newtonsoft.Json.JsonIgnore] //fortest orp 2017.10.06
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]//找到此行代码,并在上面加入忽略序列化特性
(vs2019版本)
C:Program Files (x86)Microsoft Visual Studio2019EnterpriseCommon7IDEItemTemplatesCSharpData2052DbCtxCSEF6