public async Task <IActionResult> AllIntegrationEvents(
            [FromQuery(Name = "$filter")] string filter   = "",
            [FromQuery(Name = "$orderby")] string orderBy = "",
            [FromQuery(Name = "$top")] int top            = 100,
            [FromQuery(Name = "$skip")] int skip          = 0)
        {
            try
            {
                ODataHelper <IntegrationEvent> oDataHelper = new ODataHelper <IntegrationEvent>();
                var oData = oDataHelper.GetOData(HttpContext, oDataHelper);

                var response = _repository.Find(null, oData.Filter, oData.Sort, oData.SortDirection, oData.Skip, oData.Top);
                IntegrationEventEntitiesLookupViewModel eventLogList = new IntegrationEventEntitiesLookupViewModel();

                if (response != null)
                {
                    eventLogList.EntityNameList = new List <string>();

                    foreach (var item in response.Items)
                    {
                        eventLogList.EntityNameList.Add(item.EntityType);
                    }
                    eventLogList.EntityNameList = eventLogList.EntityNameList.Distinct().ToList();
                }
                return(Ok(eventLogList));
            }
            catch (Exception ex)
            {
                return(ex.GetActionResult());
            }
        }
        public IntegrationEventEntitiesLookupViewModel AllIntegrationEvents()
        {
            var response = repository.Find(null, x => x.IsDeleted == false);
            IntegrationEventEntitiesLookupViewModel eventLogList = new IntegrationEventEntitiesLookupViewModel();

            if (response != null)
            {
                eventLogList.EntityNameList = new List <string>();

                foreach (var item in response.Items)
                {
                    eventLogList.EntityNameList.Add(item.EntityType);
                }
                eventLogList.EntityNameList = eventLogList.EntityNameList.Distinct().ToList();
            }
            return(eventLogList);
        }
Exemple #3
0
        public async Task <IActionResult> AllIntegrationEvents()
        {
            try
            {
                var response = _repository.Find(null, x => x.IsDeleted == false);
                IntegrationEventEntitiesLookupViewModel eventLogList = new IntegrationEventEntitiesLookupViewModel();

                if (response != null)
                {
                    eventLogList.EntityNameList = new List <string>();

                    foreach (var item in response.Items)
                    {
                        eventLogList.EntityNameList.Add(item.EntityType);
                    }
                    eventLogList.EntityNameList = eventLogList.EntityNameList.Distinct().ToList();
                }
                return(Ok(eventLogList));
            }
            catch (Exception ex)
            {
                return(ex.GetActionResult());
            }
        }