Ejemplo n.º 1
0
        private static ContentValidator GetValidator(this ContentOperation operation, bool optimize, bool published)
        {
            var validationContext =
                new ValidationContext(operation.Resolve <IJsonSerializer>(),
                                      operation.App.NamedId(),
                                      operation.Schema.NamedId(),
                                      operation.SchemaDef,
                                      operation.Components,
                                      operation.CommandId)
                .Optimized(optimize).AsPublishing(published);

            var validator =
                new ContentValidator(operation.Partition(),
                                     validationContext,
                                     operation.Resolve <IEnumerable <IValidatorsFactory> >(),
                                     operation.Resolve <ILogger <ContentValidator> >());

            return(validator);
        }
Ejemplo n.º 2
0
 public static void GenerateDefaultValues(this ContentOperation operation, ContentData data)
 {
     data.GenerateDefaultValues(operation.Schema.SchemaDef, operation.Partition());
 }