Пример #1
0
        public async Task ModifyMemberInfoAsync(Int32 userId, MemberDto memberDto)
        {
            Check.IfNullOrZero(userId);
            Check.IfNullOrZero(memberDto);

            var member = await _memberContext.GetMemberAsync(userId, memberDto.Id, memberDto.MemberType == MemberType.Folder);

            member.ModifyIconUrl(memberDto.IconUrl);
            member.ModifyName(memberDto.Name);
            member.ModifyWidth(memberDto.Width);
            member.ModifyHeight(memberDto.Height);

            member = memberDto.IsIconByUpload ? member.IconFromUpload() : member.IconNotFromUpload();
            member = memberDto.IsResize ? member.Resize() : member.NotResize();
            member = memberDto.IsOpenMax ? member.OpenMax() : member.NotOpenMax();
            member = memberDto.IsFlash ? member.Flash() : member.NotFlash();

            await _memberContext.ModifyMemberInfoAsync(userId, member);

            await CacheHelper.RemoveKeyWhenModify(new DesktopCacheKey(userId));
        }