This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Security.Claims; | |
| using Microsoft.AspNetCore.Authentication; | |
| namespace Duende.Extensions; | |
| internal static class SecurityExtensions | |
| { | |
| private static readonly ClaimsPrincipal Anonymous = new(new ClaimsIdentity()); | |
| extension(ClaimsPrincipal) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections.Generic; | |
| using System.Runtime.CompilerServices; | |
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Jobs; | |
| using BenchmarkDotNet.Order; | |
| using BenchmarkDotNet.Running; | |
| // ReSharper disable ArrangeObjectCreationWhenTypeEvident | |
| /* | |
| To run these benchmarks, you'll need to add some target frameworks in the .csproj file and add the BenchmarkDotNet package reference: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// The RolesAttribute extends the <see cref="AuthorizeAttribute"/> by allowing you to just assign a list of strings. | |
| /// </summary> | |
| public class RolesAttribute : AuthorizeAttribute | |
| { | |
| public RolesAttribute(params string[] roles) | |
| { | |
| if (roles == null) | |
| throw new ArgumentNullException("roles", "roles can not be a null reference."); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Imports System.Collections.Generic | |
| Imports System.ComponentModel | |
| Imports System.Reflection | |
| Imports System.Linq | |
| Imports System.Linq.Dynamic | |
| ''' <summary> | |
| ''' SortableBindingList is a list that supports sorting its items and filtering them. | |
| ''' When binding a <see cref="System.Collections.Generic.List(Of T)"/> to a <see cref="System.Windows.Forms.DataGridView"/>, you can not sort by clicking on the columns | |
| ''' or filter the list. With this list, you can. |