コード例 #1
0
        public CreateAppValidator(IAppRules appRules) : base(appRules)
        {
            _appRules = appRules;

            RuleFor(c => c.Id)
            .NotEmpty().WithMessage("Id is required.")
            .Must(HaveUniqueId).WithMessage("An app with the same id already exists.");
        }
コード例 #2
0
        public CreateAppValidator(IAppRules appRules) : base(appRules)
        {
            _appRules = appRules;

            RuleFor(c => c.Id)
            .Must(HaveUniqueId).WithMessage("An app with the same id already exists.")
            .When(x => x.Id != Guid.Empty);
        }
コード例 #3
0
ファイル: AppController.cs プロジェクト: zzekikaya/Weapsy
 public AppController(IDispatcher dispatcher,
                      IAppRules appRules,
                      IContextService contextService)
     : base(contextService)
 {
     _dispatcher = dispatcher;
     _appRules   = appRules;
 }
コード例 #4
0
 public AppController(IAppFacade appFacade,
                      ICommandSender commandSender,
                      IAppRules appRules,
                      IContextService contextService)
     : base(contextService)
 {
     _appFacade     = appFacade;
     _commandSender = commandSender;
     _appRules      = appRules;
 }
コード例 #5
0
 public AppController(ICommandSender commandSender,
                      IQueryDispatcher queryDispatcher,
                      IAppRules appRules,
                      IContextService contextService)
     : base(contextService)
 {
     _commandSender   = commandSender;
     _queryDispatcher = queryDispatcher;
     _appRules        = appRules;
 }
コード例 #6
0
        public CreateModuleTypeValidator(IModuleTypeRules moduleTypeRules, IAppRules appRules)
            : base(moduleTypeRules)
        {
            _moduleTypeRules = moduleTypeRules;
            _appRules        = appRules;

            RuleFor(c => c.Id)
            .NotEmpty().WithMessage("Id is required.")
            .Must(HaveUniqueId).WithMessage("A module type with the same id already exists.");

            RuleFor(c => c.AppId)
            .NotEmpty().WithMessage("App id is required.")
            .Must(BeAnExistingApp).WithMessage("App does not exist.");
        }
コード例 #7
0
        public AppDetailsValidator(IAppRules appRules)
        {
            _appRules = appRules;

            RuleFor(c => c.Name)
            .NotEmpty().WithMessage("App name is required.")
            .Length(1, 100).WithMessage("App name length must be between 1 and 100 characters.")
            .Must(HaveUniqueName).WithMessage("A app with the same name already exists.");

            RuleFor(c => c.Description)
            .Length(1, 4000).WithMessage("Culture name length must be between 1 and 4000 characters.")
            .When(c => !string.IsNullOrWhiteSpace(c.Description));

            RuleFor(c => c.Folder)
            .NotEmpty().WithMessage("App folder is required.")
            .Length(1, 100).WithMessage("App url length must be between 1 and 100 characters.")
            .Must(HaveValidFolder).WithMessage("App folder is not valid. Enter only letters and 1 hyphen.")
            .Must(HaveUniqueFolder).WithMessage("A app with the same folder already exists.");
        }
コード例 #8
0
 public UpdateAppDetailsValidator(IAppRules appRules) : base(appRules)
 {
 }