示例#1
0
 public override void Configure(
     ApiConfiguration configuration,
     Type type)
 {
     base.Configure(configuration, type);
     Assert.Same(typeof(TestApiWithParticipants), type);
     configuration.SetProperty(this.Value, true);
 }
示例#2
0
 public override void Configure(
     ApiConfiguration configuration,
     Type type)
 {
     base.Configure(configuration, type);
     Assert.Same(typeof(TestApiWithParticipants), type);
     configuration.SetProperty(this.Value, true);
 }
        private static ICollection <string> GetIgnoredPropertiesImplementation(this ApiConfiguration configuration)
        {
            var ignoredProperties = configuration.GetProperty <ICollection <string> >(IgnoredPropertiesKey);

            if (ignoredProperties == null)
            {
                ignoredProperties = new HashSet <string>();
                configuration.SetProperty(IgnoredPropertiesKey, ignoredProperties);
            }

            return(ignoredProperties);
        }
        /// <summary>
        /// Adds an API permission to an API configuration.
        /// </summary>
        /// <param name="configuration">
        /// An API configuration.
        /// </param>
        /// <param name="permission">
        /// An API permission.
        /// </param>
        public static void AddPermission(
            this ApiConfiguration configuration,
            ApiPermission permission)
        {
            Ensure.NotNull(configuration, "configuration");
            Ensure.NotNull(permission, "permission");
            var permissions = configuration.GetProperty <List <ApiPermission> >(Permissions);

            if (permissions == null)
            {
                permissions = new List <ApiPermission>();
                configuration.SetProperty(Permissions, permissions);
            }

            permissions.Add(permission);
        }