예제 #1
0
        private void HandleGetRelationshipOperation(List <string> operands)
        {
            if (operands.Count == 2)
            {
                var name            = operands[0];
                var relationshipStr = operands[1];
                if (!String.IsNullOrWhiteSpace(relationshipStr) &&
                    Enum.TryParse <Relationship>(relationshipStr.Replace("-", ""), out var relationship))
                {
                    var relations = _modelProcessor.GetRelationsForPerson(name, relationship).ToList();

                    Console.WriteLine(relations.Count > 0
                        ? String.Join(" ", relations.Select(person => person.Name))
                        : "NONE");
                }
            }
        }