Example #1
0
        public static IAccessControlBuilder AddControlAccessStrategy <TControlAccessStrategy>(this IAccessControlBuilder builder, ServiceLifetime serviceLifetime) where TControlAccessStrategy : IControlAccessStrategy
        {
            if (null == builder)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            builder.Services.Add(new ServiceDescriptor(typeof(IControlAccessStrategy), typeof(TControlAccessStrategy), serviceLifetime));
            return(builder);
        }
Example #2
0
 public static IAccessControlBuilder AddControlAccessStrategy <TControlAccessStrategy>(this IAccessControlBuilder builder) where TControlAccessStrategy : IControlAccessStrategy
 {
     return(AddControlAccessStrategy <TControlAccessStrategy>(builder, ServiceLifetime.Singleton));
 }