File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
src/content/code/language-support/c-net/server Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -5,4 +5,32 @@ url: https://github.com/ChilliCream/hotchocolate
5
5
github : ChilliCream/hotchocolate
6
6
---
7
7
8
+ ``` csharp
9
+ using Microsoft .AspNetCore ;
10
+ using Microsoft .AspNetCore .Hosting ;
11
+ using Microsoft .AspNetCore .Builder ;
12
+ using Microsoft .Extensions .DependencyInjection ;
8
13
14
+ WebHost
15
+ .CreateDefaultBuilder (args )
16
+ .ConfigureServices (services =>
17
+ services
18
+ .AddGraphQLServer ()
19
+ .AddQueryType <Query >())
20
+ .Configure (builder =>
21
+ builder
22
+ .UseRouting ()
23
+ .UseEndpoints (e => e .MapGraphQL ()))
24
+ .Build ()
25
+ .Run ();
26
+
27
+ public class Query
28
+ {
29
+ public Hero GetHero () => new Hero ();
30
+ }
31
+
32
+ public class Hero
33
+ {
34
+ public string Name => " Luke Skywalker" ;
35
+ }
36
+ ```
You can’t perform that action at this time.
0 commit comments