开发者

What is the use case for Access.BackingField in Fluent NHibernate?

The documentation for Access.BackingField() indicat开发者_如何学Pythones that this:

Sets the access-strategy to use the backing-field of an auto-property.

I understand that auto-properties get compiled with backing fields, but if the property is by definition a vanilla getter/setter, what advantage is garnered by going to the backing field directly versus using the setter (i.e. using the FNH defaults).

The only thing I can think of is that one might want the mapping to break if someone later adds logic to the setter.

What am I missing?


Ah, I think I found the answer here.

Use the backing field if the auto-property has a private accessor.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜