async public Task <IEnumerable <Dictionary> > GetDictionaryByTypeName([Required][FromQuery] string TypeName)
        {
            var filter = new DictionaryFilter()
            {
                TypeName = TypeName
            };

            return(await Db.GetListSpAsync <Dictionary, DictionaryFilter>(filter));
        }
Beispiel #2
0
        public RecordHandler(String recordName)
        {
            _recordName = recordName;

            var cfg = Configuration.Config.GetConfig <AmqpConfig>(AmqpConfig.SECTION_NAME);

            _exchange = cfg.Exchange;
            _topic    = recordName;
            var record_cfg = cfg.Records[recordName];


            if (record_cfg != null)
            {
                if (!String.IsNullOrEmpty(record_cfg.Exchange))
                {
                    _exchange = record_cfg.Exchange;
                }

                if (!String.IsNullOrEmpty(record_cfg.TopicSpec))
                {
                    _topic = record_cfg.TopicSpec;
                }

                if (record_cfg.Filter != null)
                {
                    List <String> fnames = new List <string>();

                    foreach (AmqpField f in record_cfg.Filter.Fields)
                    {
                        fnames.Add(f.Name);
                    }

                    _filter = DictionaryFilterFactory.CreateFilter <string, object>(record_cfg.Filter.Mode, fnames);
                }


                if (record_cfg.Headers != null)
                {
                    _headers = new Dictionary <string, string>();
                    foreach (AmqpRecordHeaderConfig header in record_cfg.Headers)
                    {
                        if (header.HeaderKey.CompareTo(GENERATION_KEY) != 0)
                        {
                            _headers.Add(header.HeaderKey, header.HeaderValueSpec);
                        }
                    }
                }
            }
        }
 async public Task <PagingResult <Dictionary> > GetPagingDictionaryByTypeName([FromQuery] Paging paging, [FromQuery] DictionaryFilter filter)
 {
     return(await Db.GetPagingListSpAsync <Dictionary, DictionaryFilter>(paging, filter));
 }