Ejemplo n.º 1
0
 public StepService(ICacheManager cacheManager,
                    IStepRepository stepRepository,
                    IPointRepository pointRepository) : base(cacheManager)
 {
     _stepRepository  = stepRepository;
     _pointRepository = pointRepository;
 }
Ejemplo n.º 2
0
 public RecipeController(
     IRecipeRepository recipeRepo,
     IRecipeIngredientRepository ingredientRepo,
     IStepRepository stepRepo,
     IRecipeImageRepository imageRepo,
     IRecipeRateRepository rateRepo,
     ICategoryRepository categoriesRepo,
     IBookmarkRepository bookMarkRepo,
     IRecipeCategoryRepository categoryRepo,
     IUserRepository userRepo,
     IHostingEnvironment environment,
     IHttpContextAccessor accessor
     )
 {
     this.recipeRepo     = recipeRepo;
     this.ingredientRepo = ingredientRepo;
     this.stepRepo       = stepRepo;
     this.imageRepo      = imageRepo;
     this.rateRepo       = rateRepo;
     this.categoriesRepo = categoriesRepo;
     this.bookMarkRepo   = bookMarkRepo;
     this.categoryRepo   = categoryRepo;
     this.userRepo       = userRepo;
     this.environment    = environment;
     this.accessor       = accessor;
 }
Ejemplo n.º 3
0
 public StepArtifactService(
     IBatchRepository batchRepository,
     IStepRepository stepRepository)
 {
     this.batchRepository = batchRepository;
     this.stepRepository  = stepRepository;
 }
Ejemplo n.º 4
0
 public StepOptionService(
     IBatchRepository batchRepository,
     IStepRepository stepRepository)
 {
     this.batchRepository = batchRepository;
     this.stepRepository  = stepRepository;
 }
Ejemplo n.º 5
0
 public BaseStep(IExecutionRepository executionRepository, IStepRepository stepRepository,
                 IExtendedFieldRepository extendedFieldRepository)
 {
     _executionRepository     = executionRepository;
     _stepRepository          = stepRepository;
     _extendedFieldRepository = extendedFieldRepository;
 }
Ejemplo n.º 6
0
 public StepsController(
     DataContext context,
     IStepRepository stepRepository)
 {
     _context        = context;
     _stepRepository = stepRepository;
 }
Ejemplo n.º 7
0
 public StepVariableService(
     IBatchRepository batchRepository,
     IStepRepository stepRepository)
 {
     this.batchRepository = batchRepository;
     this.stepRepository  = stepRepository;
 }
Ejemplo n.º 8
0
        protected override void ConfigureAppHost(IContainer container)
        {
            batchRepository = Substitute.For <IBatchRepository>();
            container.AddTransient(() => batchRepository);

            stepRepository = Substitute.For <IStepRepository>();
            container.AddTransient(() => stepRepository);
        }
Ejemplo n.º 9
0
 public DishService(DatabaseContext context, IConfiguration config, IDishRepository dishRepo, IIngredientRepository ingredientRepo, IStepRepository stepRepo, IHistoryRepository historyRepo)
 {
     _context        = context;
     _config         = config;
     _dishRepo       = dishRepo;
     _ingredientRepo = ingredientRepo;
     _stepRepo       = stepRepo;
     _historyRepo    = historyRepo;
 }
Ejemplo n.º 10
0
 public CommandVariableService(
     IBatchRepository batchRepository,
     IStepRepository stepRepository,
     ICommandRepository commandRepository)
 {
     this.batchRepository   = batchRepository;
     this.stepRepository    = stepRepository;
     this.commandRepository = commandRepository;
 }
Ejemplo n.º 11
0
        public static GetAllTextStepDataResponse GetAllTextSteps(GetAllTextStepDataRequest request)
        {
            GetAllTextStepDataResponse result = new GetAllTextStepDataResponse();

            IStepRepository <GetAllTextStepDataResponse> repo = StepRepositoryFactory <GetAllTextStepDataResponse> .GetStepRepository(request.ContractNumber, request.Context, "text");

            repo.UserId = request.UserId;
            result      = repo.SelectAll() as GetAllTextStepDataResponse;

            return(result);
        }
Ejemplo n.º 12
0
        public static GetTextStepDataResponse GetTextStepByID(GetTextStepDataRequest request)
        {
            GetTextStepDataResponse result = new GetTextStepDataResponse();

            IStepRepository <GetTextStepDataResponse> repo = StepRepositoryFactory <GetTextStepDataResponse> .GetStepRepository(request.ContractNumber, request.Context, textstep);

            repo.UserId = request.UserId;
            result      = repo.FindByID(request.TextStepID) as GetTextStepDataResponse;

            return(result != null ? result : new GetTextStepDataResponse());
        }
Ejemplo n.º 13
0
 public RouteStepService(ICacheManager cacheManager,
                         IRouteBaseRepository routeBaseRepository,
                         IPointRepository pointRepository,
                         IStepRepository stepRepository,
                         IComputeRoutePaths computeRoutePaths) : base(cacheManager)
 {
     _routeBaseRepository = routeBaseRepository;
     _pointRepository     = pointRepository;
     _stepRepository      = stepRepository;
     _computeRoutePaths   = computeRoutePaths;
 }
Ejemplo n.º 14
0
 public StepsController(IStepRepository thisRepo = null)
 {
     if (thisRepo == null)
     {
         this.stepRepo = new EFStepRepository();
     }
     else
     {
         this.stepRepo = thisRepo;
     }
 }
Ejemplo n.º 15
0
 public RecipesController(IRecipeRepository recipeRepository, IAuthorRepository authorRepository, ICategoryRepository categoryRepository
                          , IReviewRepository reviewRepository, IStepRepository stepRepository, IIngredientRepository ingredientRepository, ICountryRepository countryRepository)
 {
     _recipeRepository     = recipeRepository;
     _authorRepository     = authorRepository;
     _categoryRepository   = categoryRepository;
     _reviewRepository     = reviewRepository;
     _stepRepository       = stepRepository;
     _ingredientRepository = ingredientRepository;
     _countryRepository    = countryRepository;
 }
Ejemplo n.º 16
0
        public bool IsSatisfiedBy(IStepRepository stepRepository, SkipContext skipContext)
        {
            if (SkipLimit == 0)
                return false;

            int exceptionCount = stepRepository.GetExceptionCount(skipContext);
            if (exceptionCount >= SkipLimit || !_skippableExceptions.Contains(skipContext.GetExceptionType()))
                return false;

            stepRepository.SaveExceptionInfo(skipContext, exceptionCount);
            return true;
        }
Ejemplo n.º 17
0
        public RecipeService(IRecipeRepository recipeRepository, IRecipeIngredientRepository recipeIngredientRepository,
                             IStepRepository stepRepository, IRecipeHistoryRepository recipeHistoryRepository,
                             ISecurityService securityService)
        {
            RecipeRepository           = recipeRepository;
            RecipeIngredientRepository = recipeIngredientRepository;
            StepRepository             = stepRepository;
            RecipeHistoryRepository    = recipeHistoryRepository;
            RecipeParser = new RecipeParser(new ParserConfiguration());

            SecurityService = securityService;
        }
Ejemplo n.º 18
0
        /// <summary>Constructor to the calculator of the best path between an origin and a destination point.</summary>
        /// <param name="pointRepository">Point repository.</param>
        /// <param name="stepRepository">Step repository.</param>
        /// <param name="routeBase">Route base holding the origin and destination points.</param>
        public BestPathCalculator(IPointRepository pointRepository, IStepRepository stepRepository, RouteBase routeBase, PathPerformanceOptions option)
        {
            _pointRepository = pointRepository;
            _stepRepository  = stepRepository;
            _routeBase       = routeBase;
            _pathOption      = option;
            _pointStepsList  = new List <PointSteps>();

            _isVisited = new List <Point>();

            StepsCollection = new StepsCollection();
        }
Ejemplo n.º 19
0
        public bool Process(StepContext stepContext, IStepRepository stepRepository)
        {
            // Create a new target folder, if necessary.
            if (!Directory.Exists(_targetPath))
                Directory.CreateDirectory(_targetPath);

            string destinationFile = Path.Combine(_targetPath, _fileName);

            // Copy the file to dest location and overwriter the destination file if it already exists.
            File.Copy(_source, destinationFile, true);

            return true;
        }
Ejemplo n.º 20
0
 public MyFeelsQueryHandler(
     IEventRepository eventRepository,
     IStepRepository stepRepository,
     IStepDetailsRepository stepDetailsRepository,
     ILocalTimeZoneConvertProvider localTimeZoneConvertProvider,
     FIL.Logging.ILogger logger)
 {
     _stepDetailsRepository        = stepDetailsRepository;
     _eventRepository              = eventRepository;
     _stepRepository               = stepRepository;
     _localTimeZoneConvertProvider = localTimeZoneConvertProvider;
     _logger = logger;
 }
Ejemplo n.º 21
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GamePageViewModel"/> class.
        /// </summary>
        /// <param name="navigationService">NavigationService interface, injected</param>
        /// <param name="step">Step repository interface, injected</param>
        public GamePageViewModel(INavigationService navigationService, IStepRepository step)
        {
            this.navigationService  = navigationService;
            this.NavigateTeam       = new DelegateCommand(this.GoToTeam);
            this.NavigateValidation = new DelegateCommand(this.GoToValidation);
            this.stepRepo           = step;

            CurrentUser.CurrentStep = step.GetCurrentStep(CurrentUser.Player.Id);

            this.ParcoursName    = CurrentUser.CurrentStep.RouteName;
            this.StepName        = CurrentUser.CurrentStep.StepName;
            this.StepDescription = CurrentUser.CurrentStep.StepDescription;
        }
Ejemplo n.º 22
0
 public InstructionController(IInstructionRepository repoInstr,
                              IStepRepository repoStep, UserManager <User> userManager,
                              ApplicationContext ctx, ILikeRepository repoLike,
                              ITagRepository repoTag, ICommentRepository repoComment)
 {
     repositoryInstr   = repoInstr;
     repositoryStep    = repoStep;
     repositoryTag     = repoTag;
     repositoryLike    = repoLike;
     repositoryComment = repoComment;
     _userManager      = userManager;
     context           = ctx;
 }
Ejemplo n.º 23
0
        public static IStepRepository <T> GetStepRepository(string dbName, string productName, string type)
        {
            IStepRepository <T> repo = null;

            if (type.Equals("yesno", StringComparison.InvariantCultureIgnoreCase))
            {
                repo = new MongoYesNoStepRepository <T>(dbName) as IStepRepository <T>;
            }
            else if (type.Equals("text", StringComparison.InvariantCultureIgnoreCase))
            {
                repo = new MongoTextStepRepository <T>(dbName) as IStepRepository <T>;
            }
            return(repo);
        }
Ejemplo n.º 24
0
        public bool Process(StepContext stepContext, IStepRepository stepRepository)
        {
            // Create a new target folder, if necessary.
            if (!Directory.Exists(_targetPath))
            {
                Directory.CreateDirectory(_targetPath);
            }

            string destinationFile = Path.Combine(_targetPath, _fileName);

            // Copy the file to dest location and overwriter the destination file if it already exists.
            File.Copy(_source, destinationFile, true);

            return(true);
        }
Ejemplo n.º 25
0
        public bool Process(StepContext stepContext, IStepRepository stepRepository)
        {
            bool        success = true;
            StepContext ctx     = StepContext.InitialRun(stepContext, _chunkSize);

            while (ctx.HasNext)
            {
                long newStepId = stepRepository.InsertStep(ctx.StepName, ctx.NextStepIndex);

                bool          exceptionThrown = false;
                bool          skip            = false;
                bool          error           = false;
                List <TInput> items           = Enumerable.Empty <TInput>().ToList();
                TOutput[]     processed       = Enumerable.Empty <TOutput>().ToArray();

                try
                {
                    items = _reader.Read(ctx.StepIndex, _chunkSize).ToList();

                    processed = items.Select(item => _processor.Process(item)).ToArray();

                    if (processed.Any())
                    {
                        success &= _writer.Write(processed);
                    }
                }
                catch (Exception ex)
                {
                    error = true;
                    skip  = _skipPolicy.IsSatisfiedBy(stepRepository, new SkipContext(ctx.StepName, ctx.NextStepIndex, ex));
                    if (!skip)
                    {
                        exceptionThrown = true;
                        throw;
                    }
                }
                finally
                {
                    if (!exceptionThrown)
                    {
                        ctx = StepContext.Increment(ctx, items.Count, processed.Length, skip);
                    }

                    stepRepository.UpdateStep(newStepId, processed.Length, error, skip);
                }
            }
            return(success);
        }
Ejemplo n.º 26
0
        /// <summary>Constructor to the calculator of all paths between an origin and a destination point.</summary>
        /// <param name="pointRepository">Point repository.</param>
        /// <param name="stepRepository">Step repository.</param>
        /// <param name="routeBase">Route base holding the origin and destination points.</param>
        public AllPathsCalculator(IPointRepository pointRepository, IStepRepository stepRepository, RouteBase routeBase)
        {
            _pointRepository = pointRepository;
            _stepRepository  = stepRepository;
            _pointStepsList  = new List <PointSteps>();
            _isVisited       = new List <Point>();

            Route = new Route
            {
                Id                  = routeBase.Id,
                Origin              = routeBase.Origin,
                OriginId            = routeBase.Origin.Id,
                Destination         = routeBase.Destination,
                DestinationId       = routeBase.Destination.Id,
                StepsCollectionList = new List <StepsCollection>()
            };
        }
Ejemplo n.º 27
0
        public bool IsSatisfiedBy(IStepRepository stepRepository, SkipContext skipContext)
        {
            if (SkipLimit == 0)
            {
                return(false);
            }

            int exceptionCount = stepRepository.GetExceptionCount(skipContext);

            if (exceptionCount >= SkipLimit || !_skippableExceptions.Contains(skipContext.GetExceptionType()))
            {
                return(false);
            }

            stepRepository.SaveExceptionInfo(skipContext, exceptionCount);
            return(true);
        }
Ejemplo n.º 28
0
 public StepQueryHandler(IEventRepository eventRepository,
                         IStepDetailsRepository stepDetailsRepository,
                         IEventStepDetailRepository eventStepDetailRepository,
                         IStepProvider stepProvider,
                         IZoomUserRepository zoomUserRepository,
                         IEventDetailRepository eventDetailRepository,
                         IStepRepository stepRepository
                         )
 {
     _eventRepository           = eventRepository;
     _stepRepository            = stepRepository;
     _stepDetailsRepository     = stepDetailsRepository;
     _eventStepDetailRepository = eventStepDetailRepository;
     _stepProvider          = stepProvider;
     _eventDetailRepository = eventDetailRepository;
     _zoomUserRepository    = zoomUserRepository;
 }
Ejemplo n.º 29
0
 public RecipeDbRepository(
     IDbImageRepository images,
     IIngrediantRepository ingrediants,
     IRecipeRepository recipes,
     ISourceRepository <RecipeUrlSource> urlSources,
     ISourceRepository <RecipeCookbookSource> cookbookSources,
     IStepRepository steps,
     ITagsRepository tags
     )
 {
     this.Images          = images;
     this.Ingrediants     = ingrediants;
     this.Recipes         = recipes;
     this.UrlSources      = urlSources;
     this.CookBookSources = cookbookSources;
     this.Steps           = steps;
     this.Tags            = tags;
 }
Ejemplo n.º 30
0
 public WaterMetersController(
     DataContext context,
     IWaterMeterRepository waterMeterRepository,
     IBillRepository billRepository,
     IStepRepository stepRepository,
     ICityRepository cityRepository,
     IUserHelper userHelper,
     IChartHelper chartHelper,
     IPdfHelper pdfHelper,
     IMailHelper mailHelper)
 {
     _context = context;
     _waterMeterRepository = waterMeterRepository;
     _billRepository       = billRepository;
     _stepRepository       = stepRepository;
     _userHelper           = userHelper;
     _cityRepository       = cityRepository;
     _chartHelper          = chartHelper;
     _pdfHelper            = pdfHelper;
     _mailHelper           = mailHelper;
 }
Ejemplo n.º 31
0
        public RecipeStepService(IStepRepository rep, IRecipeRepository recipeRep, IMapper mapper, ILoggerFactory loggerFactory)
        {
            if (rep == null)
            {
                throw new ArgumentNullException(nameof(rep));
            }
            if (recipeRep == null)
            {
                throw new ArgumentNullException(nameof(recipeRep));
            }
            if (mapper == null)
            {
                throw new ArgumentNullException(nameof(mapper));
            }
            if (loggerFactory == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

            this._recipeRep = recipeRep;
            this.Logger     = loggerFactory?.CreateLogger <RecipeStepService>();
            this.Mapper     = mapper;
            this.Repository = rep;
        }
Ejemplo n.º 32
0
 public ComputeRoutePaths(ICacheManager cacheManager, IStepRepository stepRepository, IPointRepository pointRepository)
 {
     _cacheManager    = cacheManager;
     _stepRepository  = stepRepository;
     _pointRepository = pointRepository;
 }