Пример #1
0
        public async Task <GenericResult> ValidateAsync(object manager, TModule module)
        {
            var theManager = this.GetManager <TModule, IModuleManager <TModule, TProject> >(manager);
            var errors     = new List <GenericError>();

            await this.ValidateNameAsync(theManager, Accessor, module, errors,
                                         name => ErrorDescriber.InvalidModuleName(name), name => ErrorDescriber.DuplicateModuleName(name));

            var internalMethod = GetType().GetMethod("ValidateInternalAsync",
                                                     System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);

            if (internalMethod != null)
            {
                internalMethod.Invoke(this, new object[] { manager, module, errors });
            }

            return(GenericResult.GetResult(errors));
        }