Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions samples/datasync-server/src/Sample.Datasync.Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using CommunityToolkit.Datasync.Server;
using CommunityToolkit.Datasync.Server.NSwag;
using CommunityToolkit.Datasync.Server.OpenApi;
using CommunityToolkit.Datasync.Server.Swashbuckle;
using Microsoft.EntityFrameworkCore;
using Sample.Datasync.Server.Db;
Expand Down Expand Up @@ -33,10 +34,10 @@
_ = builder.Services.AddSwaggerGen(options => options.AddDatasyncControllers());
}

//if (openApiEnabled)
//{
// _ = builder.Services.AddOpenApi(options => options.AddDatasyncTransformers());
//}
if (openApiEnabled)
{
_ = builder.Services.AddOpenApi(options => options.AddDatasyncTransformers());
}

WebApplication app = builder.Build();

Expand All @@ -59,12 +60,13 @@
_ = app.UseSwagger().UseSwaggerUI();
}

if (openApiEnabled)
{
_ = app.MapOpenApi(pattern: "swagger/{documentName}/swagger.json");
_ = app.UseSwaggerUI(options => options.SwaggerEndpoint("/swagger/v1/swagger.json", "Sample.Datasync.Server v1"));
}

app.UseAuthorization();
app.MapControllers();

//if (openApiEnabled)
//{
// _ = app.MapOpenApi(pattern: "swagger/{documentName}/swagger.json");
//}

app.Run();
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
Expand All @@ -7,13 +7,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Datasync.Server" Version="9.0.0" />
<PackageReference Include="CommunityToolkit.Datasync.Server.EntityFrameworkCore" Version="9.0.0" />
<PackageReference Include="CommunityToolkit.Datasync.Server.NSwag" Version="9.0.0" />
<PackageReference Include="CommunityToolkit.Datasync.Server.Swashbuckle" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.1">
<PackageReference Include="CommunityToolkit.Datasync.Server" Version="9.0.1" />
<PackageReference Include="CommunityToolkit.Datasync.Server.EntityFrameworkCore" Version="9.0.1" />
<PackageReference Include="CommunityToolkit.Datasync.Server.NSwag" Version="9.0.1" />
<PackageReference Include="CommunityToolkit.Datasync.Server.OpenApi" Version="9.0.1" />
<PackageReference Include="CommunityToolkit.Datasync.Server.Swashbuckle" Version="9.0.1" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down