public static HtmlString Avatar(this HtmlHelper htmlHelper, Profile profile, string className, bool isSmall = false) { return htmlHelper.Avatar( profile.GetFirstHeadshot(isSmall), profile.Gender, profile.UserId, profile.Nickname, className); }
private string AvatarUrl(Profile profile) { var photo = profile.GetFirstHeadshot(true); var url = ""; if (string.IsNullOrEmpty(photo)) { //Use one of the default avatars url = "/Content/images/"; url += profile.Gender == OkbConstants.MALE ? "no-avatar-male-chat.png" : "no-avatar-female-chat.png"; } else { //use user profile photo var baseUrl = ConfigurationManager.AppSettings["StorageUrl"] + OkbConstants.PHOTO_CONTAINER + "/"; url = baseUrl + profile.UserId + "/" + photo; } return url; }