Esempio n. 1
0
        public Task <NestedProvider> AsyncObjectMethod(
            int intArg,
            string stringArg,
            NestedProvider objArg,
            int[] intArrayArg,
            RequestContext requestContext,
            ApiRequest apiRequest)
        {
            Assert.Equal(1, intArg);
            Assert.Equal("test", stringArg);
            Assert.NotNull(objArg);
            Assert.Equal("nested test", objArg.SyncScalarField);

            Assert.NotNull(intArrayArg);
            Assert.Equal(3, intArrayArg.Length);
            Assert.Equal(7, intArrayArg[0]);
            Assert.Equal(8, intArrayArg[1]);
            Assert.Equal(9, intArrayArg[2]);

            Assert.NotNull(requestContext);
            Assert.NotNull(apiRequest);
            Assert.Equal("asyncObjectMethod", apiRequest.FieldName);

            return(Task.FromResult(new NestedProvider {
                SyncScalarField = "returned type"
            }));
        }
Esempio n. 2
0
        public string SyncScalarMethod(
            int intArg,
            string stringArg,
            NestedProvider objArg,
            RequestContext requestContext,
            ApiRequest apiRequest)
        {
            Assert.Equal(1, intArg);
            Assert.Equal("test", stringArg);
            Assert.NotNull(objArg);
            Assert.Equal("nested test", objArg.SyncScalarField);

            Assert.NotNull(requestContext);
            Assert.NotNull(apiRequest);
            Assert.Equal("syncScalarMethod", apiRequest.FieldName);

            return("ok");
        }