Rock.Model.AuthService.Get C# (CSharp) Метод

Get() публичный Метод

Returns an enumerable collection of Rock.Model.Auth entities by Rock.Model.EntityType and entity Id.
public Get ( int entityTypeId, int entityId ) : IQueryable
entityTypeId int A representing the EntityId of the that this Auth entity applies to.
entityId int A represent the EntityId of the entity that is being secured.
Результат IQueryable
        public IQueryable<Auth> Get( int entityTypeId, int? entityId )
        {
            return Queryable( "PersonAlias" )
                .Where( t =>
                    t.EntityTypeId == entityTypeId &&
                    ( t.EntityId == entityId || ( entityId == null && t.EntityId == null ) )
                )
                .OrderBy( t => t.Order );
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Handles the Delete event of the rGrid control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RowEventArgs"/> instance containing the event data.</param>
        protected void rGrid_Delete(object sender, RowEventArgs e)
        {
            var rockContext = new RockContext();
            var authService = new Rock.Model.AuthService(rockContext);

            Rock.Model.Auth auth = authService.Get(e.RowKeyId);
            if (auth != null)
            {
                authService.Delete(auth);
                rockContext.SaveChanges();

                Authorization.ReloadAction(iSecured.TypeId, iSecured.Id, CurrentAction);
            }

            BindGrid();
        }
All Usage Examples Of Rock.Model.AuthService::Get
AuthService