GetByLayout() public méthode

Returns an enumerable collection of Rock.Model.Block">Blocks that are implemented as part of a
public GetByLayout ( int layoutId ) : IQueryable
layoutId int An representing the Id of the that the block belongs to.
Résultat IQueryable
        /// <summary>
        /// Binds the group members grid.
        /// </summary>
        protected void BindLayoutBlocksGrid()
        {
            pnlBlocks.Visible = false;

            int layoutId = PageParameter( "layoutId" ).AsInteger();
            if ( layoutId == 0 )
            {
                pnlContent.Visible = false;
                return;
            }

            var rockContext = new RockContext();
            var layout = LayoutCache.Read( layoutId, rockContext );
            if (layout == null)
            {
                pnlContent.Visible = false;
                return;
            }

            hfLayoutId.SetValue( layoutId );

            pnlBlocks.Visible = true;

            BlockService blockService = new BlockService( new RockContext() );

            gLayoutBlocks.DataSource = blockService.GetByLayout( layoutId ).ToList();
            gLayoutBlocks.DataBind();
        }
        /// <summary>
        /// Binds the group members grid.
        /// </summary>
        protected void BindLayoutBlocksGrid()
        {
            pnlBlocks.Visible = false;

            int layoutId = PageParameter( "layoutId" ).AsInteger() ?? 0;
            if ( layoutId == 0 )
            {
                return;
            }

            hfLayoutId.SetValue( layoutId );

            pnlBlocks.Visible = true;

            BlockService blockService = new BlockService( new RockContext() );

            gLayoutBlocks.DataSource = blockService.GetByLayout( layoutId ).ToList();
            gLayoutBlocks.DataBind();
        }