为什么在 SOAP 中,linq 不导出实体引用的完整属性,在此示例中仅导出 ImagesReference 的 EntityKeyMember 而没有导出 Images 实体的其他属性
<images_likes>
<EntityKey>
<EntitySetName>Images_Likes</EntitySetName>
<EntityContainerName>WiredinEntities</EntityContainerName>
<EntityKeyValues>
<EntityKeyMember>
<Key>LikeId</Key>
<Value xsi:type="xsd:int">96</Value>
</EntityKeyMember>
</EntityKeyValues>
</EntityKey>
<LikeId>96</LikeId>
<Date>2012-07-27T09:00:35.697</Date>
<ImagesReference>
<EntityKey>
<EntitySetName>Images</EntitySetName>
<EntityContainerName>WiredinEntities</EntityContainerName>
<EntityKeyValues>
<EntityKeyMember>
<Key>ImageId</Key>
<Value xsi:type="xsd:int">26</Value>
</EntityKeyMember>
</EntityKeyValues>
</EntityKey>
</ImagesReference>
public static List<Images_Likes> GetLikes(int ImageId)
{
using (WiredinEntities context = new WiredinEntities("name=WiredinEntities"))
{
var items = from item in context.Images_Likes.Include("Images")
where item.Images.ImageId == ImageId
select item;
return items.ToList();
}
}