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."); }
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); }
public AppController(IDispatcher dispatcher, IAppRules appRules, IContextService contextService) : base(contextService) { _dispatcher = dispatcher; _appRules = appRules; }
public AppController(IAppFacade appFacade, ICommandSender commandSender, IAppRules appRules, IContextService contextService) : base(contextService) { _appFacade = appFacade; _commandSender = commandSender; _appRules = appRules; }
public AppController(ICommandSender commandSender, IQueryDispatcher queryDispatcher, IAppRules appRules, IContextService contextService) : base(contextService) { _commandSender = commandSender; _queryDispatcher = queryDispatcher; _appRules = appRules; }
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."); }
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."); }
public UpdateAppDetailsValidator(IAppRules appRules) : base(appRules) { }