Duplicating a site from v8 to v10 and have most code updated, but this one throws me still. It's just a view to show a photo directory of the intranet members:
@using Umbraco.Core.Services
IMemberService memberService = Services.MemberService;
IOrderedEnumerable<IMember> members; // THROWS ERROR
members = memberService.GetMembersByGroup("MainOffice);
foreach (var member in members) { // display member photos and such }
But in v10, I keep getting the error "The type or namespace name 'IMember' could not be found" on the line noted above.
I've added "@inject IMemberService MemberService" to the top but still no luck. Wondering if there are some other @using or @inject statements I need? Or different syntax entirely? (I've already perused the v10 Sample Docs but no memberservice examples there.)
The MemberService acts as a "gateway" to Umbraco data for operations which are related to Members. Browse the API documentation for IMemberService. All samples in this document will require references to the following dll: Umbraco.
Teco Sign In
MemberService in Umbraco 10 views
Duplicating a site from v8 to v10 and have most code updated, but this one throws me still. It's just a view to show a photo directory of the intranet members:
But in v10, I keep getting the error "The type or namespace name 'IMember' could not be found" on the line noted above.
I've added "@inject IMemberService MemberService" to the top but still no luck. Wondering if there are some other @using or @inject statements I need? Or different syntax entirely? (I've already perused the v10 Sample Docs but no memberservice examples there.)
Sounds like you haven't included the Umbraco Models as a using, not sure what it is in v9, but in v10 you need
@using Umbraco.Cms.Core.Models
I had Umbraco.Cms.Core.Models.PublishedContent, forgot to drop back a level to just .Models
Thanks so much.
The MemberService acts as a "gateway" to Umbraco data for operations which are related to Members. Browse the API documentation for IMemberService. All samples in this document will require references to the following dll: Umbraco. Teco Sign In
is working on a reply...