Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="query"></param>
        /// <param name="op"></param>
        /// <returns></returns>
        private IQueryable <AlbumEntity> Query_Dependencies(ref IQueryable <AlbumEntity> query, EntitiesOptions op)
        {
            /*if (op.IsDependOn(EnumEntitiesDependencies.None))
             * {
             *  log.Debug($"{typeof(EntitiesQueryExtension).Name}.{MethodBase.GetCurrentMethod().Name} : EnumEntitiesDependencies.None");
             *  return query;
             * }*/

            // Load Pictures dependencies if required.
            if (op.IsDependOn(EnumEntitiesDependencies.PicturesInAlbums))
            {
                log.Debug($"{typeof(EntitiesQueryExtension).Name}.{MethodBase.GetCurrentMethod().Name} : EnumEntitiesDependencies.PicturesInAlbums");
                query = query.Include(x => x.PicturesInAlbums);
            }

            // Load Sections dependencies if required.
            if (op.IsDependOn(EnumEntitiesDependencies.AlbumsInSections) || op.UserId > 0)
            {
                log.Debug($"{typeof(EntitiesQueryExtension).Name}.{MethodBase.GetCurrentMethod().Name} : EnumEntitiesDependencies.AlbumsInSections");
                query = query.Include(x => x.AlbumsInSections);
            }

            // Load Infos dependencies if required.
            if (op.IsDependOn(EnumEntitiesDependencies.InfosInAlbums))
            {
                log.Debug($"{typeof(EntitiesQueryExtension).Name}.{MethodBase.GetCurrentMethod().Name} : EnumEntitiesDependencies.InfosInAlbums");
                query = query.Include(x => x.InfosInAlbums);
            }

            return(query);
        }
Esempio n. 2
0
        /// <summary>
        /// Method to get a list of Section entities.
        /// </summary>
        /// <param name="dependencies">Load also dependencies.</param>
        /// <returns>A list of Section entities.</returns>
        private void QueryDependencies(ref IQueryable <InfoType> query, EntitiesOptions op = null)
        {
            // Load ACLGroup dependency if requered.
            if (op.IsDependOn(EnumEntitiesDependencies.InfosInAlbums))
            {
                query = query.Include(x => x.InfosInAlbums);
            }

            // Load Album dependency if requered.
            if (op.IsDependOn(EnumEntitiesDependencies.InfosInPictures))
            {
                query = query.Include(x => x.InfosInPictures);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Method to get a list of Section entities.
        /// </summary>
        /// <param name="query"></param>
        /// <param name="op"></param>
        /// <returns>A list of Section entities.</returns>
        private void QueryDependencies(ref IQueryable <SectionEntity> query, EntitiesOptions op = null)
        {
            // Load ACLGroup dependency if required.
            if (op.IsDependOn(EnumEntitiesDependencies.SectionsInAclGroups))
            {
                query = query.Include(x => x.SectionsInAclGroups);
            }

            // Load Album dependency if required.
            if (op.IsDependOn(EnumEntitiesDependencies.AlbumsInSections))
            {
                query = query.Include(x => x.AlbumsInSections);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Method to include dependencies to a <see cref="IQueryable"/> query of <see cref="PictureEntity"/>.
        /// </summary>
        /// <param name="query">A <see cref="IQueryable"/> query of <see cref="PictureEntity"/>.</param>
        /// <param name="op">The <see cref="EntitiesOptions"/> list of options for filter the query.</param>
        /// <returns>A list of Section entities.</returns>
        private void QueryDependencies(ref IQueryable <PictureEntity> query, EntitiesOptions op = default(PictureOptionsList))
        {
            // Initialize default option select.
            op = op ?? new PictureOptionsSelect();

            // Load Album dependency if required.
            if (op.IsDependOn(EnumEntitiesDependencies.PicturesInAlbums) || User != null)
            {
                query.Include(x => x.PicturesInAlbums);
            }

            // Load Info dependency if required.
            if (op.IsDependOn(EnumEntitiesDependencies.InfosInPictures))
            {
                query.Include(x => x.InfosInPictures);
            }
        }
Esempio n. 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="query"></param>
        /// <param name="op"></param>
        /// <returns></returns>
        private IQueryable <AclGroupEntity> Query_Dependencies(IQueryable <AclGroupEntity> query, EntitiesOptions op)
        {
            // Load AclActions dependencies if required.
            if (op.IsDependOn(EnumEntitiesDependencies.AclGroupsInAclActions))
            {
                query = query.Include(x => x.AclGroupsInAclActions);
            }

            // Load Users dependencies if required.
            if (op.IsDependOn(EnumEntitiesDependencies.UsersInAclGroups))
            {
                query = query.Include(x => x.UsersInAclGroups);
            }

            // Load Sections dependencies if required.
            if (op.IsDependOn(EnumEntitiesDependencies.SectionsInAclGroups))
            {
                query = query.Include(x => x.SectionsInAclGroups);
            }

            return(query);
        }