C#学习教程:使用MongoDBC#映射私有支持字段我的模型看起来像:publicclassCompetitor{privateIList_competitorBests;公共虚拟intCompetitorId{得到;放;}publicvirtualstringName{get{if(Type=="Team")returnTeamName;返回名字+“”+姓氏;}}publicvirtualIEnumerableCompetitorBests{get{return_competitorBests.ToArray();我基本上是在尝试将_competitorBests映射到CompetitorBests(存在于mongo的文档中)注意:此模型由NHibernate共享(因此为virtual)我在文档中看不到任何明显的内容。我应该怎么办?就是这样:以上就是C#学习教程:使用MongoDBC#映射私有支持字段分享的所有内容。如果对大家有用,需要进一步了解C#学习教程,希望大家多多关注——BsonClassMap.RegisterClassMap(cm=>{cm.AutoMap();cm.MapField("_competitorBests")。SetElementName("CompetitorBests");});本文收集自网络,不代表立场。如涉及侵权,请点击右侧联系管理员删除。如需转载请注明出处:
