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; }
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(@"\", @"/"); }
private string GetAvatarLocation(User user, string pictureStorage) { return _pictureService.GetPictureLocation(pictureStorage, user.Id, user.Avatar, "_ava"); }