示例#1
0
        public RestrictionModule(IRestrictionService restrictionService)
        {
            _restrictionService = restrictionService;

            GetResourceById = Get;
            GetResourceAll  = GetAll;
            CreateResource  = Create;
            UpdateResource  = Update;
            DeleteResource  = Delete;
        }
示例#2
0
        public RestrictionController(IRestrictionService restrictionService)
        {
            _restrictionService = restrictionService;

            SharedValidator.RuleFor(d => d).Custom((restriction, context) =>
            {
                if (restriction.Ignored.IsNullOrWhiteSpace() && restriction.Required.IsNullOrWhiteSpace())
                {
                    context.AddFailure("Either 'Must contain' or 'Must not contain' is required");
                }
            });
        }
示例#3
0
        public void LoadRestriction(IRestrictionService restrictionService)
        {
            IEnumerable <RestrictionView> restricts = restrictionService.GetAllRestrictions().Restrictions;

            restrictions.Clear();
            foreach (RestrictionView restrict in restricts)
            {
                if (!restrictions.ContainsKey(restrict.RestrictionName))
                {
                    restrictions.Add(restrict.RestrictionName, restrict.RequirePermission);
                }
            }
        }
示例#4
0
 public TagService(ITagRepository repo,
                   IEventAggregator eventAggregator,
                   IDelayProfileService delayProfileService,
                   IImportListFactory importListFactory,
                   INotificationFactory notificationFactory,
                   IRestrictionService restrictionService,
                   IMovieService movieService)
 {
     _repo                = repo;
     _eventAggregator     = eventAggregator;
     _delayProfileService = delayProfileService;
     _importListFactory   = importListFactory;
     _notificationFactory = notificationFactory;
     _restrictionService  = restrictionService;
     _movieService        = movieService;
 }
示例#5
0
        public RestrictionModule(IRestrictionService restrictionService)
        {
            _restrictionService = restrictionService;

            GetResourceById = GetRestriction;
            GetResourceAll  = GetAllRestrictions;
            CreateResource  = CreateRestriction;
            UpdateResource  = UpdateRestriction;
            DeleteResource  = DeleteRestriction;

            SharedValidator.RuleFor(r => r).Custom((restriction, context) =>
            {
                if (restriction.Ignored.IsNullOrWhiteSpace() && restriction.Required.IsNullOrWhiteSpace())
                {
                    context.AddFailure("Either 'Must contain' or 'Must not contain' is required");
                }
            });
        }
示例#6
0
        public RestrictionModule(IRestrictionService restrictionService)
        {
            _restrictionService = restrictionService;

            GetResourceById = GetRestriction;
            GetResourceAll  = GetAllRestrictions;
            CreateResource  = CreateRestriction;
            UpdateResource  = UpdateRestriction;
            DeleteResource  = DeleteRestriction;

            SharedValidator.Custom(restriction =>
            {
                if (restriction.Ignored.IsNullOrWhiteSpace() && restriction.Required.IsNullOrWhiteSpace())
                {
                    return(new ValidationFailure("", "Either 'Must contain' or 'Must not contain' is required"));
                }

                return(null);
            });
        }
示例#7
0
 public ReleaseRestrictionsSpecification(IRestrictionService restrictionService, Logger logger)
 {
     _restrictionService = restrictionService;
     _logger             = logger;
 }
示例#8
0
 public RestrictionController(IMapper mapper, IRestrictionService restrictionService)
 {
     this.mapper             = mapper;
     this.restrictionService = restrictionService;
 }
示例#9
0
 public ReleaseRestrictionsSpecification(ITermMatcher termMatcher, IRestrictionService restrictionService, Logger logger)
 {
     _logger             = logger;
     _restrictionService = restrictionService;
     _termMatcher        = termMatcher;
 }
示例#10
0
 public RestrictionTableController(IRestrictionService restrictionService)
 {
     _restrictionService = restrictionService;
 }
 public RestrictionDetailController(IRestrictionService restrictionService)
 {
     _restrictionService = restrictionService;
 }
 public ReleaseRestrictionsSpecification(IRestrictionService restrictionService, Logger logger)
 {
     _restrictionService = restrictionService;
     _logger = logger;
 }