protected override GetAboutMembersQueryResult OnExecuting(EmptyCriterion criterion) { AboutMembers members = GetSettings <AboutMembers>(); GetAboutMembersQueryResult result = new GetAboutMembersQueryResult { Title = members.Title, SubTitle = members.SubTitle, Member1Id = members.Member1Id, Member2Id = members.Member2Id, Member3Id = members.Member3Id, Member4Id = members.Member4Id, Members = DataContext.Users.Select(ToMember).ToList() }; return(result); }
protected override GetAboutMembersDetailsQueryResult OnExecuting(EmptyCriterion criterion) { AboutMembers members = GetSettings <AboutMembers>(); GetAboutMembersDetailsQueryResult result = new GetAboutMembersDetailsQueryResult { Title = members.Title, SubTitle = members.SubTitle }; ApplicationUser user1 = GetUser(members.Member1Id); result.MemberAbout1 = GetUserAbout(user1); result.MemberFullName1 = GetUsername(user1); result.MemberAvatarUrl1 = GetUserAvatar(user1); ApplicationUser user2 = GetUser(members.Member2Id); result.MemberAbout2 = GetUserAbout(user2); result.MemberFullName2 = GetUsername(user2); result.MemberAvatarUrl2 = GetUserAvatar(user2); ApplicationUser user3 = GetUser(members.Member3Id); result.MemberAbout3 = GetUserAbout(user3); result.MemberFullName3 = GetUsername(user3); result.MemberAvatarUrl3 = GetUserAvatar(user3); ApplicationUser user4 = GetUser(members.Member4Id); result.MemberAbout4 = GetUserAbout(user4); result.MemberFullName4 = GetUsername(user4); result.MemberAvatarUrl4 = GetUserAvatar(user4); return(result); }
protected AboutMembers ToModel(AboutMembersViewModel vm) { AboutMembers model = Mapper.Map <AboutMembers>(vm); return(model); }