标签:ssh dia for ons log serial com sys foreach
修改.tt模板文件,添加以下标红两行
<#
foreach (var navigationProperty in navigationProperties)
{
if (navigationProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many)
{
#>
[Newtonsoft.Json.JsonIgnore]
[System.Xml.Serialization.XmlIgnore]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
<#
使用
DBEntities dc = new DBEntities();
dc.Configuration.ProxyCreationEnabled = false;
var list=dc.News.ToList();
return list; //此时list可成功序列化
From:http://www.cnblogs.com/xuejianxiyang/p/6794928.html
标签:ssh dia for ons log serial com sys foreach
原文地址:http://www.cnblogs.com/xuejianxiyang/p/6794928.html