Skip to content

Add SurrealDB hosting/client integration #251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
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
9 changes: 9 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,12 @@
/examples/sql-database-projects/_ @ErikEJ @jmezach
/src/CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects/_ @ErikEJ @jmezach
/tests/CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects/_ @ErikEJ @jmezach

# CommunityToolkit.Aspire.SurrealDb
# CommunityToolkit.Aspire.Hosting.SurrealDb

/examples/surrealdb/_ @Odonno
/src/CommunityToolkit.Aspire.Hosting.SurrealDb/_ @Odonno
/tests/CommunityToolkit.Aspire.Hosting.SurrealDb.Tests/_ @Odonno
/src/CommunityToolkit.Aspire.SurrealDb/_ @Odonno
/tests/CommunityToolkit.Aspire.SurrealDb.Tests/_ @Odonno
Comment on lines +41 to +45
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the CODEOWNERS to be valid you would need to join the maintainer group - is that something you're interested in (I'm guessing so since you put yourself down as the owner 😉)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be good now. Can you reopen the PR @aaronpowell ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aaronpowell Are you there?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unable to reopen the PR, looks like the branch has had a force push done since it was closed so the PR isn't able to reopen

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I opened a new PR #365

52 changes: 52 additions & 0 deletions CommunityToolkit.Aspire.sln
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,22 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommunityToolkit.Aspire.Hos
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommunityToolkit.Aspire.Hosting.Python.Extensions.Tests", "tests\CommunityToolkit.Aspire.Hosting.Python.Extensions.Tests\CommunityToolkit.Aspire.Hosting.Python.Extensions.Tests.csproj", "{5B825CF9-E8B8-4960-9330-648ED0323FE0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommunityToolkit.Aspire.Hosting.SurrealDb", "src\CommunityToolkit.Aspire.Hosting.SurrealDb\CommunityToolkit.Aspire.Hosting.SurrealDb.csproj", "{65A9BB78-8622-4E0B-9237-A88010DC3CC0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommunityToolkit.Aspire.SurrealDb", "src\CommunityToolkit.Aspire.SurrealDb\CommunityToolkit.Aspire.SurrealDb.csproj", "{151B8E17-1B77-456F-ABDA-0B073815212F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "surrealdb", "surrealdb", "{C0EC3C39-5C97-4EC9-943F-A79B5AE551D9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommunityToolkit.Aspire.Hosting.SurrealDb.AppHost", "examples\surrealdb\CommunityToolkit.Aspire.Hosting.SurrealDb.AppHost\CommunityToolkit.Aspire.Hosting.SurrealDb.AppHost.csproj", "{B5B903D1-072D-49C2-AB06-065923E660F0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommunityToolkit.Aspire.Hosting.SurrealDb.ServiceDefaults", "examples\surrealdb\CommunityToolkit.Aspire.Hosting.SurrealDb.ServiceDefaults\CommunityToolkit.Aspire.Hosting.SurrealDb.ServiceDefaults.csproj", "{3ACB71BF-27B3-4B21-A4F8-E86296CB9C3A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommunityToolkit.Aspire.Hosting.SurrealDb.ApiService", "examples\surrealdb\CommunityToolkit.Aspire.Hosting.SurrealDb.ApiService\CommunityToolkit.Aspire.Hosting.SurrealDb.ApiService.csproj", "{E4A8D5E9-1307-45E2-8495-88B39AF67277}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommunityToolkit.Aspire.Hosting.SurrealDb.Tests", "tests\CommunityToolkit.Aspire.Hosting.SurrealDb.Tests\CommunityToolkit.Aspire.Hosting.SurrealDb.Tests.csproj", "{11BAFC2B-62E1-4FBC-8E3D-BF6103015F33}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommunityToolkit.Aspire.SurrealDb.Tests", "tests\CommunityToolkit.Aspire.SurrealDb.Tests\CommunityToolkit.Aspire.SurrealDb.Tests.csproj", "{79C10D99-D4F1-40FB-BA6B-9F4AB3776FA2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -351,6 +367,34 @@ Global
{2CC61B84-CF97-4CE7-A08F-2EECF4AEAD92}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2CC61B84-CF97-4CE7-A08F-2EECF4AEAD92}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2CC61B84-CF97-4CE7-A08F-2EECF4AEAD92}.Release|Any CPU.Build.0 = Release|Any CPU
{65A9BB78-8622-4E0B-9237-A88010DC3CC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{65A9BB78-8622-4E0B-9237-A88010DC3CC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{65A9BB78-8622-4E0B-9237-A88010DC3CC0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{65A9BB78-8622-4E0B-9237-A88010DC3CC0}.Release|Any CPU.Build.0 = Release|Any CPU
{151B8E17-1B77-456F-ABDA-0B073815212F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{151B8E17-1B77-456F-ABDA-0B073815212F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{151B8E17-1B77-456F-ABDA-0B073815212F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{151B8E17-1B77-456F-ABDA-0B073815212F}.Release|Any CPU.Build.0 = Release|Any CPU
{B5B903D1-072D-49C2-AB06-065923E660F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B5B903D1-072D-49C2-AB06-065923E660F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B5B903D1-072D-49C2-AB06-065923E660F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B5B903D1-072D-49C2-AB06-065923E660F0}.Release|Any CPU.Build.0 = Release|Any CPU
{3ACB71BF-27B3-4B21-A4F8-E86296CB9C3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3ACB71BF-27B3-4B21-A4F8-E86296CB9C3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3ACB71BF-27B3-4B21-A4F8-E86296CB9C3A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3ACB71BF-27B3-4B21-A4F8-E86296CB9C3A}.Release|Any CPU.Build.0 = Release|Any CPU
{E4A8D5E9-1307-45E2-8495-88B39AF67277}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E4A8D5E9-1307-45E2-8495-88B39AF67277}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E4A8D5E9-1307-45E2-8495-88B39AF67277}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E4A8D5E9-1307-45E2-8495-88B39AF67277}.Release|Any CPU.Build.0 = Release|Any CPU
{11BAFC2B-62E1-4FBC-8E3D-BF6103015F33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{11BAFC2B-62E1-4FBC-8E3D-BF6103015F33}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11BAFC2B-62E1-4FBC-8E3D-BF6103015F33}.Release|Any CPU.ActiveCfg = Release|Any CPU
{11BAFC2B-62E1-4FBC-8E3D-BF6103015F33}.Release|Any CPU.Build.0 = Release|Any CPU
{79C10D99-D4F1-40FB-BA6B-9F4AB3776FA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{79C10D99-D4F1-40FB-BA6B-9F4AB3776FA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79C10D99-D4F1-40FB-BA6B-9F4AB3776FA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79C10D99-D4F1-40FB-BA6B-9F4AB3776FA2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -420,6 +464,14 @@ Global
{373472DA-BAEB-44B6-915D-1EF3DA845797} = {899F0713-7FC6-4750-BAFC-AC650B35B453}
{79CBF217-CED1-4BB2-9A72-37D2429F83B8} = {899F0713-7FC6-4750-BAFC-AC650B35B453}
{2CC61B84-CF97-4CE7-A08F-2EECF4AEAD92} = {79CBF217-CED1-4BB2-9A72-37D2429F83B8}
{65A9BB78-8622-4E0B-9237-A88010DC3CC0} = {414151D4-7009-4E78-A5C6-D99EBD1E67D1}
{151B8E17-1B77-456F-ABDA-0B073815212F} = {414151D4-7009-4E78-A5C6-D99EBD1E67D1}
{C0EC3C39-5C97-4EC9-943F-A79B5AE551D9} = {8519CC01-1370-47C8-AD94-B0F326B1563F}
{B5B903D1-072D-49C2-AB06-065923E660F0} = {C0EC3C39-5C97-4EC9-943F-A79B5AE551D9}
{3ACB71BF-27B3-4B21-A4F8-E86296CB9C3A} = {C0EC3C39-5C97-4EC9-943F-A79B5AE551D9}
{E4A8D5E9-1307-45E2-8495-88B39AF67277} = {C0EC3C39-5C97-4EC9-943F-A79B5AE551D9}
{11BAFC2B-62E1-4FBC-8E3D-BF6103015F33} = {899F0713-7FC6-4750-BAFC-AC650B35B453}
{79C10D99-D4F1-40FB-BA6B-9F4AB3776FA2} = {899F0713-7FC6-4750-BAFC-AC650B35B453}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {08B1D4B8-D2C5-4A64-BB8B-E1A2B29525F0}
Expand Down
3 changes: 3 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@
<PackageVersion Include="Aspire.Hosting.NodeJS" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Hosting.Python" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Hosting.SqlServer" Version="$(AspireVersion)" />
<PackageVersion Include="Bogus" Version="35.6.1" />
<PackageVersion Include="JsonSchema.Net" Version="7.2.3" />
<!-- AspNetCore packages -->
<PackageVersion Include="AspNetCore.HealthChecks.SqlServer" Version="8.0.2" />
<PackageVersion Include="Microsoft.AspNetCore.Components.QuickGrid" Version="$(AspNetCoreVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="8.0.11" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="$(DotNetExtensionsVersion)" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="$(DotNetExtensionsVersion)" />
<PackageVersion Include="SurrealDb.MinimalApis.Extensions" Version="0.7.0" />
<PackageVersion Include="SurrealDb.Net" Version="0.6.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.9.0" />
<!-- .NET packages -->
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="$(DotNetExtensionsVersion)" />
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ This repository contains the source code for the .NET Aspire Community Toolkit,
| - **Learn More**: [`Hosting.Deno`][deno-integration-docs] <br /> - Stable 📦: [![CommunityToolkit.Aspire.Hosting.Deno][deno-shields]][deno-nuget] <br /> - Preview 📦: [![CommunityToolkit.Aspire.Hosting.Deno][deno-shields-preview]][deno-nuget-preview] | A hosting integration for the Deno apps. |
| - **Learn More**: [`Hosting.SqlDatabaseProjects`][sql-database-projects-integration-docs] <br /> - Stable 📦: [![CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects][sql-database-projects-shields]][sql-database-projects-nuget] <br /> - Preview 📦: [![CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects][sql-database-projects-shields-preview]][sql-database-projects-nuget-preview] | A hosting integration for the SQL Databases Projects. |
| - **Learn More**: [`Hosting.Rust`][rust-integration-docs] <br /> - Stable 📦: [![CommunityToolkit.Aspire.Hosting.Rust][rust-shields]][rust-nuget] <br /> - Preview 📦: [![CommunityToolkit.Aspire.Hosting.Rust][rust-shields-preview]][rust-nuget-preview] | A hosting integration for the Rust apps. |
| - **Learn More**: [`Hosting.SurrealDb`][surrealdb-integration-docs] <br /> - Stable 📦: [![CommunityToolkit.Aspire.Hosting.SurrealDb][surrealdb-shields]][surrealdb-nuget] <br /> - Preview 📦: [![CommunityToolkit.Aspire.Hosting.SurrealDb][surrealdb-shields-preview]][surrealdb-nuget-preview] | An Aspire hosting integration leveraging the [SurrealDB](https://surrealdb.com/) container. |
| - **Learn More**: [`SurrealDb`][surrealdb-integration-docs] <br /> - Stable 📦: [![CommunityToolkit.Aspire.SurrealDb][surrealdb-client-shields]][surrealdb-client-nuget] <br /> - Preview 📦: [![CommunityToolkit.Aspire.SurrealDb][surrealdb-client-shields-preview]][surrealdb-client-nuget-preview] | An Aspire client integration for the [SurrealDB](https://github.com/surrealdb/surrealdb.net/) package. |

## 🙌 Getting Started

Each of the integrations in the toolkit is available as a NuGet package, and can be added to your .NET project. Refer to the table above for the available integrations and the documentation on how to use them.
Expand Down Expand Up @@ -125,3 +128,13 @@ This project is supported by the [.NET Foundation](https://dotnetfoundation.org)
[rust-nuget]: https://nuget.org/packages/CommunityToolkit.Aspire.Hosting.Rust/
[rust-shields-preview]: https://img.shields.io/nuget/vpre/CommunityToolkit.Aspire.Hosting.Rust?label=nuget%20(preview)
[rust-nuget-preview]: https://nuget.org/packages/CommunityToolkit.Aspire.Hosting.Rust/absoluteLatest

[surrealdb-integration-docs]: https://learn.microsoft.com/dotnet/aspire/community-toolkit/hosting-surrealdb
[surrealdb-shields]: https://img.shields.io/nuget/v/CommunityToolkit.Aspire.Hosting.SurrealDb
[surrealdb-nuget]: https://nuget.org/packages/CommunityToolkit.Aspire.Hosting.SurrealDb/
[surrealdb-shields-preview]: https://img.shields.io/nuget/vpre/CommunityToolkit.Aspire.Hosting.SurrealDb?label=nuget%20(preview)
[surrealdb-nuget-preview]: https://nuget.org/packages/CommunityToolkit.Aspire.Hosting.SurrealDb/absoluteLatest
[surrealdb-client-shields]: https://img.shields.io/nuget/v/CommunityToolkit.Aspire.SurrealDb
[surrealdb-client-nuget]: https://nuget.org/packages/CommunityToolkit.Aspire.SurrealDb/
[surrealdb-client-shields-preview]: https://img.shields.io/nuget/vpre/CommunityToolkit.Aspire.SurrealDb?label=nuget%20(preview)
[surrealdb-client-nuget-preview]: https://nuget.org/packages/CommunityToolkit.Aspire.SurrealDb/absoluteLatest
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\CommunityToolkit.Aspire.SurrealDb\CommunityToolkit.Aspire.SurrealDb.csproj" />
<ProjectReference Include="..\CommunityToolkit.Aspire.Hosting.SurrealDb.ServiceDefaults\CommunityToolkit.Aspire.Hosting.SurrealDb.ServiceDefaults.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Bogus" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" />
<PackageReference Include="SurrealDb.MinimalApis.Extensions" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using SurrealDb.Net.Models;

namespace CommunityToolkit.Aspire.Hosting.SurrealDb.ApiService.Models;

public class Todo : Record
{
internal const string Table = "todo";

public string? Title { get; set; }
public DateOnly? DueBy { get; set; } = null;
public bool IsComplete { get; set; } = false;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using SurrealDb.Net.Models;

namespace CommunityToolkit.Aspire.Hosting.SurrealDb.ApiService.Models;

/// <summary>
/// Weather forecast model.
/// </summary>
public class WeatherForecast : Record
{
internal const string Table = "weatherForecast";

/// <summary>
/// Date of the weather forecast.
/// </summary>
public DateTime Date { get; set; }

/// <summary>
/// Country of the weather forecast.
/// </summary>
public string? Country { get; set; }

/// <summary>
/// Temperature in Celsius.
/// </summary>
public int TemperatureC { get; set; }

/// <summary>
/// Temperature in Fahrenheit.
/// </summary>
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);

/// <summary>
/// Summary of the weather forecast.
/// </summary>
public string? Summary { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using Bogus;

namespace CommunityToolkit.Aspire.Hosting.SurrealDb.ApiService.Models;

/// <summary>
/// Faker test class to generate fake WeatherForecast objects.
/// </summary>
public class WeatherForecastFaker : Faker<WeatherForecast>
{
private static readonly string[] Summaries = new[]
{
"Freezing",
"Bracing",
"Chilly",
"Cool",
"Mild",
"Warm",
"Balmy",
"Hot",
"Sweltering",
"Scorching"
};

/// <summary>
/// Constructor
/// </summary>
public WeatherForecastFaker()
{
RuleFor(o => o.Date, f => f.Date.Recent());
RuleFor(o => o.Country, f => f.Address.Country());
RuleFor(o => o.TemperatureC, f => f.Random.Number(-20, 55));
RuleFor(o => o.Summary, f => f.Random.ArrayElement(Summaries));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using CommunityToolkit.Aspire.Hosting.SurrealDb.ApiService.Models;
using SurrealDb.Net;

var builder = WebApplication.CreateBuilder(args);

builder.AddServiceDefaults();

builder.AddSurrealClient("db", settings =>
{
// TODO : Wait for v0.7
// settings.Options!.NamingPolicy = "CamelCase";
});

var app = builder.Build();

app.MapDefaultEndpoints();

app.MapGroup("/api")
.MapSurrealEndpoints<WeatherForecast>(
"/weatherForecast",
new() { EnableMutations = false }
)
.MapSurrealEndpoints<Todo>("/todo");

app.MapPost("/init", InitializeDbAsync);

app.Run();

Task InitializeDbAsync(ISurrealDbClient surrealDbClient)
{
const int initialCount = 5;
var weatherForecasts = new WeatherForecastFaker().Generate(initialCount);

var tasks = weatherForecasts.Select(weatherForecast =>
surrealDbClient.Create(WeatherForecast.Table, weatherForecast)
);

return Task.WhenAll(tasks);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:5284",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7079;http://localhost:5284",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<Sdk Name="Aspire.AppHost.Sdk" Version="$(AspireAppHostSdkVersion)"/>

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsAspireHost>true</IsAspireHost>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Aspire.Hosting.AppHost" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\CommunityToolkit.Aspire.Hosting.SurrealDb\CommunityToolkit.Aspire.Hosting.SurrealDb.csproj" IsAspireProjectResource="false" />
<ProjectReference Include="..\CommunityToolkit.Aspire.Hosting.SurrealDb.ApiService\CommunityToolkit.Aspire.Hosting.SurrealDb.ApiService.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Projects;

var builder = DistributedApplication.CreateBuilder(args);

var db = builder.AddSurrealServer("surreal")
.AddNamespace("ns")
.AddDatabase("db");

builder.AddProject<CommunityToolkit_Aspire_Hosting_SurrealDb_ApiService>("apiservice")
.WithReference(db)
.WaitFor(db);

builder.Build().Run();
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:11918;http://localhost:37012",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:31745",
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:12787"
}
},
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:15730",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"DOTNET_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19870",
"DOTNET_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20522"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Aspire.Hosting.Dcp": "Warning"
}
}
}
Loading