Difference between MembershipHelper and MemberService
I've just started using Umbraco 7, although I'm familiar with older versions, but I was wondering if anyone could tell me the difference between the MembershipHelper and the MemberService?
Specifically, why would you use one to get a member property and not the other? When is it best to use either object?
The MemberShipHelper is read only access (and fast because it gets it as an IPublishedContent from the cache) Use this whenever the information you need is available in this way.
MemberService is a service. The services are there to edit the data of the scope it covers and subscribe to events regarding those changes. You should only use this if you want to edit the data of a member. Getting anything from the service will query the database directly which is a lot slower than the cache and should thus be avoided at all costs for displaying data in views.
Difference between MembershipHelper and MemberService
I've just started using Umbraco 7, although I'm familiar with older versions, but I was wondering if anyone could tell me the difference between the MembershipHelper and the MemberService?
Specifically, why would you use one to get a member property and not the other? When is it best to use either object?
https://our.umbraco.org/Documentation/Reference/Querying/MemberShipHelper/
https://our.umbraco.org/documentation/Reference/Management/Services/MemberService
Very basic:
The MemberShipHelper is read only access (and fast because it gets it as an IPublishedContent from the cache) Use this whenever the information you need is available in this way.
MemberService is a service. The services are there to edit the data of the scope it covers and subscribe to events regarding those changes. You should only use this if you want to edit the data of a member. Getting anything from the service will query the database directly which is a lot slower than the cache and should thus be avoided at all costs for displaying data in views.
Thanks Sven, that's clear as a bell. Great explanation.
is working on a reply...