mongodb - Usage od UnmapProperty, UnmapMember, UnmapField -
the usage of these statements not clear me. give next example
if (!bsonclassmap.isclassmapregistered(typeof(province))) { bsonclassmap.registerclassmap<province>(cm => { cm.automap(); cm.setidmember( cm.getmembermap(c => c.provinceid).setidgenerator(uniqueidgenerator.instance)); cm.unmapproperty(c => c.countryid); cm.unmapproperty(c => c.eloqueraid); cm.unmapproperty(c => c.updatemode); }); } the lastly 2 properties have no private fields, first (countryid) has. have feeling like, when using unmapproperty, private field not ignored , should improve utilize unmapmember???
can please explain more in depth how handle these statements? or give me hint find it? give thanks you
unmapmember finds bsonmembermap corresponding system.reflection.memberinfo , removes mapping it.
both unmapfield , unmapproperty take field or property name, resolve system.reflection.memberinfo , phone call unmapmember
in way, unmapfield , unmapproperties syntactic sugar unmapmember reflection filed or property string name.
mongodb mongodb-csharp
No comments:
Post a Comment