private static MvpMember PopulateMemberData(IMember member, string category)
        {
            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 isMvpRenewal = false;

            if (category.Contains("Renewal"))
            {
                isMvpRenewal = true;
                category     = category.Replace("Renewal", string.Empty);
            }

            var mvpMember = new MvpMember
            {
                Id           = member.Id,
                Name         = member.Name,
                Avatar       = avatarHtml,
                Company      = company,
                Twitter      = twitter,
                GitHub       = github,
                Category     = category,
                IsMvpRenewal = isMvpRenewal
            };

            return(mvpMember);
        }
Exemple #2
0
        private static MvpMember PopulateMemberData(IMember member, string category)
        {
            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 mvpMember = new MvpMember
            {
                Id       = member.Id,
                Name     = member.Name,
                Avatar   = avatarHtml,
                Company  = company,
                Twitter  = twitter,
                GitHub   = github,
                Category = category
            };

            return(mvpMember);
        }