Skip to content

Commit abcdd4b

Browse files
committed
SIANXSVC-1193: Add example code to the InlineHandler
1 parent f02e21e commit abcdd4b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

examples/InlineHandler/Program.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ await Host.CreateDefaultBuilder(args)
99
var res = E5EResponse.From("test");
1010
return Task.FromResult(res);
1111
});
12+
builder.RegisterEntrypoint("Binary", request =>
13+
{
14+
// This entrypoint receives one file (type: binary) and returns an anonymous object with the length.
15+
var fileData = request.Event.AsBytes();
16+
return Task.FromResult(E5EResponse.From(new { FileLength = fileData?.LongLength }));
17+
});
18+
builder.RegisterEntrypoint("ReturnFirstFile", request =>
19+
{
20+
// This entrypoint receives multiple files as a mixed request and returns the first.
21+
var files = request.Event.AsFiles();
22+
return Task.FromResult(E5EResponse.From(files.First()));
23+
});
1224
})
1325
.UseConsoleLifetime()
1426
.Build()

0 commit comments

Comments
 (0)