示例#1
0
        public override Member ToModel(Member member)
        {
            //Call base converter first
            base.ToModel(member);

            var organization = member as Organization;

            if (organization != null && MemberRelations.Any())
            {
                organization.ParentId = MemberRelations.FirstOrDefault().AncestorId;
            }
            return(member);
        }
示例#2
0
        public override Member ToModel(Member member)
        {
            //Call base converter first
            base.ToModel(member);

            if (member is Organization organization)
            {
                organization.Description      = Description;
                organization.OwnerId          = OwnerId;
                organization.BusinessCategory = BusinessCategory;
                if (MemberRelations.Any())
                {
                    organization.ParentId = MemberRelations
                                            .FirstOrDefault(x => x.RelationType == RelationType.Membership.ToString())?
                                            .AncestorId;
                }
            }
            return(member);
        }
        public override Member ToModel(Member member)
        {
            //Call base converter first
            base.ToModel(member);

            var organization = member as Organization;

            if (organization != null)
            {
                organization.Description      = Description;
                organization.OwnerId          = OwnerId;
                organization.BusinessCategory = BusinessCategory;
                if (MemberRelations.Any())
                {
                    organization.ParentId = MemberRelations.FirstOrDefault().AncestorId;
                }
            }
            return(member);
        }