Esempio n. 1
0
        private static BadgeMember PopulateBadgeMemberData(IMember member)
        {
            var membershipHelper = new MembershipHelper(UmbracoContext.Current);
            var m = membershipHelper.GetById(member.Id);

            var company = member.GetValue <string>("company");
            var twitter = (member.GetValue <string>("twitter") ?? "").Trim().TrimStart('@');
            var github  = (member.GetValue <string>("github") ?? "").Trim().TrimStart('@');

            var badgeMember = new BadgeMember
            {
                Id      = member.Id,
                Name    = member.Name,
                Avatar  = Utils.GetMemberAvatar(m, 48),
                Company = company,
                Twitter = twitter,
                GitHub  = github
            };

            return(badgeMember);
        }
        private static BadgeMember PopulateBadgeMemberData(IMember member)
        {
            var membershipHelper = new MembershipHelper(UmbracoContext.Current);
            var m = membershipHelper.GetById(member.Id);

            var company = member.GetValue <string>("company");
            var twitter = (member.GetValue <string>("twitter") ?? "").Trim().TrimStart('@');
            var github  = (member.GetValue <string>("github") ?? "").Trim().TrimStart('@');

            var avatarService = new AvatarService();
            var avatarHtml    = avatarService.GetImgWithSrcSet(m, m.Name, 48);

            var badgeMember = new BadgeMember
            {
                Id      = member.Id,
                Name    = member.Name,
                Avatar  = avatarHtml,
                Company = company,
                Twitter = twitter,
                GitHub  = github
            };

            return(badgeMember);
        }