Ejemplo n.º 1
0
        /// <summary>
        /// Retrieves the list of all active discounts
        /// </summary>
        /// <returns>
        /// The ResultCode corresponding to the result of the operation.
        /// </returns>
        private ResultCode GetActiveDiscountIds()
        {
            IEnumerable <Guid> activeDiscounts = new List <Guid>();

            // Retrieve the list of discounts.
            Context.Log.Verbose("Retrieving list of all active discounts");
            activeDiscounts = DealOperations.RetrieveActiveDiscountIds();
            Context.Log.Verbose("{0} active discounts were retrieved from the data store.", activeDiscounts.Count());

            ((GetActiveDiscountIdsResponse)Context[Key.Response]).DiscountIds = activeDiscounts;

            return(ResultCode.Success);
        }
Ejemplo n.º 2
0
        public ReaderService()
        {
            ConnectionSettings esSettings = new ConnectionSettings(_lyoEsNode)
                                                                                        //.DefaultIndex("dealersearchentries") Optional. Wir geben den Index explizit bei jeder Query an
                                                                                        //.MapDefaultTypeIndices(x => x.Add(typeof(DealerSearchEntry), "dealersearchentries"))
                                            .DefaultFieldNameInferrer(f => f.ToLower()) // Übernimmt den Namen des Fields im Model 1:1 für die Suche (zB CreatedBy -> "CreatedBy", default ist "createdBy" (camelCase))
                                                                                        //.BasicAuthentication("elastic", "uns4f3") Ohne X-Pack Security nicht notwendig
                                            .RequestTimeout(TimeSpan.FromSeconds(5))
                                            .DisableDirectStreaming();

            _lyoEsClient = new ElasticClient(esSettings);
            _dealerSearchEntryOperations = new DealerSearchEntryOperations(_lyoEsClient);
            _dealOperations = new DealOperations(_lyoEsClient);
        }