Example #1
0
        protected CronField(string expression, ISpecificationFactory specificationFactory = null)
        {
            Guard.AgainstNullOrEmptyString(expression, nameof(expression));

            Expression            = expression;
            _specificationFactory = specificationFactory;
        }
 public LookupsController(ILookupsRepository repository,
                          IIdentityService identityService,
                          ISpecificationFactory specificationFactory)
 {
     _repository           = repository;
     _identityService      = identityService;
     _specificationFactory = specificationFactory;
 }
Example #3
0
 public TaskService(ITaskRepository tasksRepository, ILogger <TaskService> logger, IMapper mapper, INotifierService notifierService, ISpecificationFactory specFactory)
 {
     _tasksRepository = tasksRepository;
     _logger          = logger;
     _mapper          = mapper;
     _notifierService = notifierService;
     _specFactory     = specFactory;
 }
Example #4
0
        public ISpecificationFactory GetSpecificationFactory()
        {
            if (specificationFactory == null)
            {
                specificationFactory = new SpecificationFactory();
            }

            return(specificationFactory);
        }
Example #5
0
        public Controller(IModel model, IEventAggregator eventAggregator, IOptionsController optionsController,
                          ISpecificationFactory specificationFactory)
        {
            this.model                = model;
            this.eventAggregator      = eventAggregator;
            this.optionsController    = optionsController;
            this.specificationFactory = specificationFactory;

            UpdateMetadataOptions();
        }
Example #6
0
 public CoffeeService(ISpecificationFactory specificationFactory,
                      IReadRepository <CoffeeMachine> coffeeMachineRepository,
                      IReadRepository <CoffeePod> coffeePodRepository,
                      ILogger <CoffeeService> logger)
 {
     _coffeeMachineRepository = coffeeMachineRepository;
     _coffeePodRepository     = coffeePodRepository;
     _specificationFactory    = specificationFactory;
     _logger = logger;
 }
Example #7
0
        public CronExpression(string expression, DateTime date, ISpecificationFactory specificationFactory = null)
        {
            Guard.AgainstNullOrEmptyString(expression, nameof(expression));

            Expression = expression;

            _cronDate             = Truncate(date);
            _specificationFactory = specificationFactory ?? new DefaultSpecificationFactory();

            ParseExpression(expression);
        }
 public StandardAccountFactory(
     Currency primaryCurrency,
     IAccountStatusAwareOperations statusAwareOperations,
     IAccountDepositMethod balanceUpdateMethod,
     ISpecificationFactory <IAccountIdentity, LoyaltyPointAccountIdentitySpecification> identityFactory)
 {
     this.primaryCurrency       = primaryCurrency;
     this.statusAwareOperations = statusAwareOperations;
     this.balanceUpdateMethod   = balanceUpdateMethod;
     this.identityFactory       = identityFactory;
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="repsitory"></param>
 /// <param name="specificationFactory"></param>
 /// <param name="identityService"></param>
 /// <param name="domainService"></param>
 /// <param name="lookupsRepository"></param>
 /// <param name="reportService"></param>
 /// <param name="configuration"></param>
 public NoAuthUserController(IReadAsyncRepository <NoAuthUser> repsitory,
                             ISpecificationFactory specificationFactory,
                             IIdentityService identityService, IDomainService <NoAuthUser> domainService,
                             ILookupsRepository lookupsRepository, IReportService reportService,
                             IConfiguration configuration) : base(repsitory, domainService, specificationFactory, identityService)
 {
     _lookupsRepository    = lookupsRepository;
     _reportService        = reportService;
     _specificationFactory = specificationFactory;
     _configuration        = configuration;
 }
 public void SetUp()
 {
     eventAggregator = MockRepository.GenerateStub<IEventAggregator>();
     
     optionsController = MockRepository.GenerateStub<IOptionsController>();
     optionsController.Stub(oc => oc.GetCurrentSettings()).Return(new Settings());
     
     specificationFactory = MockRepository.GenerateStub<ISpecificationFactory>();
     
     searchController = new Controller(new Icarus.Search.Model(), eventAggregator, 
         optionsController, specificationFactory);
 }
Example #11
0
        public void SetUp()
        {
            eventAggregator = MockRepository.GenerateStub <IEventAggregator>();

            optionsController = MockRepository.GenerateStub <IOptionsController>();
            optionsController.Stub(oc => oc.GetCurrentSettings()).Return(new Settings());

            specificationFactory = MockRepository.GenerateStub <ISpecificationFactory>();

            searchController = new Controller(new Icarus.Search.Model(), eventAggregator,
                                              optionsController, specificationFactory);
        }
        public LoyaltyPointAccountFactory(
            Currency primaryCurrency,
            LoyaltyPointAccount.IAccountState createdState,
            LoyaltyPointAccount.IAccountState activeState,
            LoyaltyPointAccount.IAccountState inactiveState,
            ISpecificationFactory <LoyaltyPointAccountIdentity, LoyaltyPointAccountIdentitySpecification> identityFactory)
        {
            this.primaryCurrency = CtorGuard.NotNull(primaryCurrency, nameof(primaryCurrency));
            this.createdState    = CtorGuard.NotNull(createdState, nameof(createdState));
            this.activeState     = CtorGuard.NotNull(activeState, nameof(activeState));
            this.inactiveState   = CtorGuard.NotNull(inactiveState, nameof(inactiveState));

            this.identityFactory = CtorGuard.NotNull(identityFactory, nameof(identityFactory));
        }
        public CronDayOfMonth(string expression, ISpecificationFactory specificationFactory = null)
            : base(expression, specificationFactory)
        {
            switch (expression.ToLower())
            {
            case "?":
            {
                ExpressionType = ExpressionType.Skipped;

                // will be determined by day-of-week field
                return;
            }

            case "l":
            {
                ExpressionType = ExpressionType.LastDayOfMonth;

                AddSpecification(new LastDayOfMonthSpecification());

                return;
            }

            case "lw":
            {
                ExpressionType = ExpressionType.LastWeekDayOfMonth;

                AddSpecification(new LastWeekDayOfMonthSpecification());

                return;
            }
            }

            var match = _weekdayExpression.Match(expression);

            if (match.Success)
            {
                ExpressionType = ExpressionType.NearestWeekDay;

                AddSpecification(new RangeSpecification(Convert.ToInt32(match.Groups["day"].Value)));

                return;
            }

            DefaultParsing(FieldName.DayOfMonth, 1, 31);
        }
Example #14
0
 public RecurrenceCreatorService(
     ITaskRepository taskRepository,
     IPlannedRecurrenceRepository plannedRecurrenceRepository,
     IDateService dateService,
     ILogger <RecurrenceCreatorService> logger,
     ITaskParserService taskParserService,
     INotifierService notifierService,
     IMapper mapper,
     ISpecificationFactory specFactory)
 {
     _taskRepository = taskRepository;
     _plannedRecurrenceRepository = plannedRecurrenceRepository;
     _dateService       = dateService;
     _logger            = logger;
     _taskParserService = taskParserService;
     _notifierService   = notifierService;
     _mapper            = mapper;
     _specFactory       = specFactory;
 }
Example #15
0
 public BlogService(ISpecificationFactory specificationFactory,
                    IReadRepository <Blog> repository)
 {
     _blogRepository       = repository;
     _specificationFactory = specificationFactory;
 }
Example #16
0
 public GenericControllerBase(IReadAsyncRepository <TEntity> repository, IDomainService <TEntity> domainService, ISpecificationFactory specificationFactory, IIdentityService identityService)
 {
     _repository          = repository;
     _identityService     = identityService;
     _searchSpecification = specificationFactory.Create <TEntity>();
     _domainService       = domainService;
 }
Example #17
0
 public NodesController(INodeFactory nodeFactory, ISpecificationFactory <AppSpecInformation, AppSpecSearchResult> appSpecificationFactory, IGatherer gatherer, ILoggerFactory logger) : base(logger)
 {
     _nodeFactory             = nodeFactory;
     _appSpecificationFactory = appSpecificationFactory;
     _gatherer = gatherer;
 }
 internal void Register(Type t, ISpecificationFactory factory)
 => this.factories.Add(t, factory);
 public SpecificationBuilder(ISpecificationFactory specificationFactory)
 {
     _specificationFactory = specificationFactory;
 }
 public static ISpecification <T> WithId <T>(this ISpecificationFactory <T> _, int id)
     where T : EntityBase
 => new EntitySpecification <T>(id);
Example #21
0
 public OsSpecsController(ISpecificationFactory <OsSpecInformation, OsSpecSearchResult> specificationFactory, ILoggerFactory logger) : base(specificationFactory, logger)
 {
 }
Example #22
0
 public RecurrenceService(IPlannedRecurrenceRepository plannedRecurrenceRepository, IMapper mapper, ISpecificationFactory specFactory)
 {
     _plannedRecurrenceRepository = plannedRecurrenceRepository;
     _mapper      = mapper;
     _specFactory = specFactory;
 }
Example #23
0
 protected SpecsControllerBase(ISpecificationFactory <TInfo, TSearch> specFactory, ILoggerFactory logger) : base(logger)
 {
     SpecFactory = specFactory;
 }
Example #24
0
        public CronMonth(string value, ISpecificationFactory specificationFactory = null)
            : base(MonthExpression.Replace(value,
                                           match =>
        {
            switch (match.Value.ToLower())
            {
            case "jan":
                {
                    return("1");
                }

            case "feb":
                {
                    return("2");
                }

            case "mar":
                {
                    return("3");
                }

            case "apr":
                {
                    return("4");
                }

            case "may":
                {
                    return("5");
                }

            case "jun":
                {
                    return("6");
                }

            case "jul":
                {
                    return("7");
                }

            case "aug":
                {
                    return("8");
                }

            case "sep":
                {
                    return("9");
                }

            case "oct":
                {
                    return("10");
                }

            case "nov":
                {
                    return("11");
                }

            default:
                {
                    return("12");
                }
            }
        }), specificationFactory)
        {
            DefaultParsing(FieldName.Month, 1, 12);
        }
 public SampleWorkStep4(ILogger <SampleWorkStep4> logger, ISpecificationFactory specificationFactory, IDecoratorFactory decoratorFactory)
     : base(logger)
 {
     this.SpecificationFactory = specificationFactory;
     this.DecoratorFactory     = decoratorFactory;
 }
 public UserController(IUserService userService, ISpecificationFactory <UserRegistrationRequest> registrationSpecificationFactory)
 {
     this.userService = userService;
     this.registrationSpecificationFactory = registrationSpecificationFactory;
 }
Example #27
0
 public CronMinute(string expression, ISpecificationFactory specificationFactory = null) : base(expression, specificationFactory)
 {
     DefaultParsing(FieldName.Minute, 0, 59);
 }
Example #28
0
 public CronHour(string expression, ISpecificationFactory specificationFactory = null) : base(expression, specificationFactory)
 {
     DefaultParsing(FieldName.Hour, 0, 23);
 }
Example #29
0
 public TodoService(ITodoRepository repository, IEntityFactory entityFactory, ISpecificationFactory specificationFactory)
 {
     this.repository           = repository;
     this.entityFactory        = entityFactory;
     this.specificationFactory = specificationFactory;
 }
        public CronDayOfWeek(string value, ISpecificationFactory specificationFactory = null)
            : base(NameExpression.Replace(value,
                                          match =>
        {
            switch (match.Value.ToLower())
            {
            case "sun":
                {
                    return("1");
                }

            case "mon":
                {
                    return("2");
                }

            case "tue":
                {
                    return("3");
                }

            case "wed":
                {
                    return("4");
                }

            case "thu":
                {
                    return("5");
                }

            case "fri":
                {
                    return("6");
                }

            default:
                {
                    return("7");
                }
            }
        }), specificationFactory)
        {
            if (value.Equals("?"))
            {
                ExpressionType = ExpressionType.Skipped;

                // will be determined by day-of-week field
                return;
            }

            var match = OccurrenceExpression.Match(value);

            if (match.Success)
            {
                ExpressionType = ExpressionType.WeekDayOccurrence;

                AddSpecification(new WeekDayOccurenceSpecification(Convert.ToInt32(match.Groups["day"].Value),
                                                                   Convert.ToInt32(match.Groups["occurrence"].Value)));

                return;
            }

            DefaultParsing(FieldName.DayOfWeek, 1, 7);
        }
Example #31
0
 public CronExpression(string expression, ISpecificationFactory specificationFactory = null)
     : this(expression, DateTime.Now, specificationFactory)
 {
 }