Example #1
0
        public UserInfo GetUserInfo(User user, string pictureStorage)
        {
            var userInfo = new UserInfo()
            {
                Id = user.Id,
                Username = user.UserName,
                FirstName = user.FirstName,
                LastName = user.LastName,
                Birthday = user.Birthday
            };

            if (!string.IsNullOrEmpty(pictureStorage) && user.Avatar != null)
                userInfo.AvatarLocation = "/" + GetAvatarLocation(user, pictureStorage).Replace(@"\", @"/");

            return userInfo;
        }
Example #2
0
        private string GetUserAvatarLocation(User user)
        {
            if (user.Avatar == null)
                return string.Empty;

            var avatarLocation = "/" + _pictureService.GetPictureLocation(ConfigurationManager.AppSettings["pictureStorage"],
                            user.Id, user.Avatar, "_ava");

            return avatarLocation.Replace(@"\", @"/");
        }
Example #3
0
 private string GetAvatarLocation(User user, string pictureStorage)
 {
     return _pictureService.GetPictureLocation(pictureStorage, user.Id, user.Avatar, "_ava");
 }