示例#1
0
        private UmbracoUtils()
        {
            if (ApplicationContext.Current == null)
            {
                throw new FluentException("Current Umbraco application context is not loaded.");
            }

            FileService = ApplicationContext.Current.Services.FileService;

            ContentTypeService = ApplicationContext.Current.Services.ContentTypeService;

            DataTypeService = ApplicationContext.Current.Services.DataTypeService;

            UmbracoDatabase = new UmbracoDatabaseAdaptor();

            AliasValidator = new AliasValidator();
        }
示例#2
0
        /// <summary>
        /// Method to validate model
        /// </summary>
        /// <returns>Returns the result of validation</returns>
        protected override FluentValidation.Results.ValidationResult Validate()
        {
            var validator = new AliasValidator();

            return(validator.Validate(this));
        }