Esempio n. 1
0
        public static void Resolve(this ClassAttributeReference reference, IClassModel classModel)
        {
            if (reference.Target != null)
            {
                return;
            }

            var attribute = classModel.Attributes.FirstOrDefault(x => x.Name == reference.Name);

            if (attribute == null)
            {
                throw new ParseException(reference.ParseLocation, $"Attribute '{reference.Name}' not found from class model '{classModel.FullyQualifiedName}'.");
            }

            reference.Target = attribute;
        }
Esempio n. 2
0
        public static void Resolve(this ClassAttributeReference reference, IClassRelation relation)
        {
            if (reference.Target != null)
            {
                return;
            }

            var attribute = relation.Attributes.FirstOrDefault(x => x.Name == reference.Name);

            if (attribute == null)
            {
                throw new ParseException(reference.ParseLocation, $"Attribute '{reference.Name}' not found from relation '{relation.Name}'.");
            }

            reference.Target = attribute;
        }