Exemple #1
0
        public static Profile GetFrom(CustomerAccount user)
        {
            if (user == null)
                return null;


            return new Profile
            {
                uid = user.id,
                account = user.username,
                email = user.email,
                nickname = user.nickname,
                gender = user.gender,
                vip = user.vip,
                avatar = user.GetValidAvatarUrl(),
                cover = user.GetValidCoverUrl(),
                country_code = user.country_code,
                country_name = user.country_name,
                bio = user.bio ?? string.Empty, // string is reference type, default is null //
                inviter = user.inviter_username,
                gtoken = user.gtoken,
                locale = string.IsNullOrEmpty(user.locale) ? ConstantCommon.BABEL_DEFAULT_LOCALE : user.locale,
                is_venvici_member = user.is_venvici_member

            };
        }