public override async Task UpdatePositions()
        {
            var memberPositions = new List <MemberPositionDto>();

            foreach (var position in preferredPositions)
            {
                var memberPosition = new MemberPositionDto()
                {
                    Position    = Positions.FirstOrDefault(p => p.Name == position),
                    Association = AssociationType.Preferred
                };

                memberPositions.Add(memberPosition);
            }

            foreach (var position in assignedPositions)
            {
                var memberPosition = new MemberPositionDto()
                {
                    Position    = Positions.FirstOrDefault(p => p.Name == position),
                    Association = AssociationType.Assigned
                };

                memberPositions.Add(memberPosition);
            }

            foreach (var position in preferredPositions)
            {
                if (assignedPositions.Contains(position))
                {
                    var memberPosition = new MemberPositionDto()
                    {
                        Position    = Positions.FirstOrDefault(p => p.Name == position),
                        Association = AssociationType.PreferredAndAssigned
                    };

                    memberPositions.Add(memberPosition);
                }
            }

            Member.Positions = memberPositions;

            await MemberChanged.InvokeAsync(Member);
        }
Exemple #2
0
        public virtual async Task UpdatePositions()
        {
            var memberPositions = new List <MemberPositionDto>();

            foreach (var position in preferredPositions)
            {
                var memberPosition = new MemberPositionDto()
                {
                    Position    = Positions.FirstOrDefault(p => p.Name == position),
                    Association = AssociationType.Preferred
                };

                memberPositions.Add(memberPosition);
            }

            Member.Positions = memberPositions;

            await MemberChanged.InvokeAsync(Member);
        }