Example #1
0
        /// <summary>
        ///
        /// </summary>
        private ModelDashboards SearchDashboardsByTags(EntityPlaylist entity)
        {
            var repo = new DashboardRepository(DataContext);

            var tags = entity
                       .Items
                       .Where(x => x.Type == Playlists.PlaylistItemType.DashboardByTag)
                       .Select(x => x.Value)
                       .ToList();

            var res = repo.Search(new DashboardSearchFilter()
            {
                Tags        = tags,
                TagOperator = SearchOperator.Or
            });

            var col = (!res.HasError) ?
                      res.Value.Dashboards : Enumerable.Empty <ModelDashboard>();

            return(col.ToList());
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        private ModelDashboards SearchDashboardsById(EntityPlaylist entity)
        {
            var repo = new DashboardRepository(DataContext);

            var ids = entity
                      .Items
                      .Where(x => x.Type == Playlists.PlaylistItemType.DashboardById)
                      .Where(x => int.TryParse(x.Value, out int res))
                      .Select(x => Convert.ToInt32(x.Value))
                      .ToList();

            var res = repo.Search(new DashboardSearchFilter()
            {
                DashboardIds = ids
            });

            var col = (!res.HasError) ?
                      res.Value.Dashboards : Enumerable.Empty <ModelDashboard>();

            return(col.ToList());
        }