Ejemplo n.º 1
0
        /// <summary>
        /// Validates the structure of Resource Model
        /// </summary>
        /// <param name="definitions">Operation Definition to validate</param>
        /// <returns>true if the resource model is valid.false otherwise.</returns>
        public override IEnumerable <ValidationMessage> GetValidationMessages(Dictionary <string, Schema> definitions, RuleContext context)
        {
            var resourceModels = context.ResourceModels;

            foreach (var resourceModel in resourceModels)
            {
                if (!ValidationUtilities.ContainsReadOnlyProperties(resourceModel, definitions, ReadonlyProps))
                {
                    yield return(new ValidationMessage(new FileObjectPath(context.File, context.Path.AppendProperty(resourceModel)), this, resourceModel));
                }
            }
        }