コード例 #1
0
        public GroupTransform(IHostEnvironment env, Arguments args, IDataView input)
            : base(env, RegistrationName, input)
        {
            Host.CheckValue(args, nameof(args));
            Host.CheckUserArg(Utils.Size(args.GroupKey) > 0, nameof(args.GroupKey), "There must be at least one group key");

            _groupSchema = new GroupSchema(Host, Source.Schema, args.GroupKey, args.Column ?? new string[0]);
        }
コード例 #2
0
        private GroupTransform(IHost host, ModelLoadContext ctx, IDataView input)
            : base(host, input)
        {
            Host.AssertValue(ctx);

            // *** Binary format ***
            // (schema)
            _groupSchema = new GroupSchema(input.Schema, host, ctx);
        }
コード例 #3
0
        public async Task TestGroupSchemaEndpoint()
        {
            string json = Helpers.ReadExternalJsonFile("GroupEndpoints", "GroupSchema.json");

            IKudosApi   kudos  = new KudosApi(null, Helpers.PrepareHttpClient(json));
            GroupSchema schema = await kudos.GetGroupSchemaAsync();

            Assert.IsNotNull(schema);
        }
コード例 #4
0
        private static async Task GroupEndpoint(IKudosApi kudos)
        {
            GroupSchema schema = await kudos.GetGroupSchemaAsync();

            Groups groups = await kudos.GetGroupsAsync();

            foreach (Group group in groups.Resources)
            {
                Console.WriteLine(group.DisplayName);
            }
        }
コード例 #5
0
ファイル: SchemaTest.cs プロジェクト: wpq0/FormNG
 public void GroupSchemaCanAcceptOnlyCertainNodeType(Type nodeType, int expectedCount)
 {
     var schema = new GroupSchema("X", Activator.CreateInstance(nodeType) as NodeSchema);
     Assert.AreEqual(expectedCount, schema.Count);
 }
コード例 #6
0
        public async Task <ActionResult <GroupSchema> > UpdateGroupAsync([FromRoute] int id, [FromBody] GroupSchema body)
        {
            try
            {
                var result = await this.SecurityService.EditGroupAsync(id, body, User.Identity.Name);

                return(Ok(result));
            }
            catch (System.Exception ex)
            {
                if (ex.Message == "not-found")
                {
                    return(NotFound());
                }

                throw;
            }
        }