Skip to content

Commit

Permalink
Sample project upgraded to .NET6
Browse files Browse the repository at this point in the history
  • Loading branch information
snifter committed Jun 8, 2023
1 parent db703ab commit 8285236
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 72 deletions.
33 changes: 15 additions & 18 deletions Sample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Graph.ArgumentValidator;
using Shared;

namespace Sample
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
var builder = WebApplication.CreateBuilder(args);

public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}
builder.Services
.AddGraphQLServer()
.AddArgumentValidator()
.AddQueryType<Query>();
builder.Services
.AddSingleton<DuplicateEmailValidatorService>();

var app = builder.Build();

app.MapGraphQL();

app.Run();
6 changes: 4 additions & 2 deletions Sample/Sample.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="HotChocolate.AspNetCore" Version="12.6.2" />
<PackageReference Include="HotChocolate.AspNetCore" Version="13.2.1" />
</ItemGroup>

<ItemGroup>
Expand Down
52 changes: 0 additions & 52 deletions Sample/Startup.cs

This file was deleted.

0 comments on commit 8285236

Please sign in to comment.