# SurrealDbServerResource

- Kind: `class`
- Package: [CommunityToolkit.Aspire.Hosting.SurrealDb](/reference/api/csharp/communitytoolkit.aspire.hosting.surrealdb.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.ApplicationModel`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d9dc6fc02412d7398c5722840513d99965a6e98f/src/CommunityToolkit.Aspire.Hosting.SurrealDb/SurrealDbServerResource.cs)
- Inherits: `ContainerResource`
- Implements: `IExpressionValue`, `IManifestExpressionProvider`, `IResource`, `IResourceWithConnectionString`, `IValueProvider`, `IValueWithReferences`

A resource that represents a SurrealDB container.

## Definition

```csharp
namespace Aspire.Hosting.ApplicationModel;

public class SurrealDbServerResource
    : Aspire.Hosting.ApplicationModel.ContainerResource,
      Aspire.Hosting.ApplicationModel.IExpressionValue,
      Aspire.Hosting.ApplicationModel.IManifestExpressionProvider,
      Aspire.Hosting.ApplicationModel.IResource,
      Aspire.Hosting.ApplicationModel.IResourceWithConnectionString,
      Aspire.Hosting.ApplicationModel.IValueProvider,
      Aspire.Hosting.ApplicationModel.IValueWithReferences
{
    // ...
}
```

## ATS metadata

### ATS export

- Type ID: `CommunityToolkit.Aspire.Hosting.SurrealDb/SurrealDbServerResource`

## Constructors

- [SurrealDbServerResource(string, ParameterResource?, ParameterResource)](/reference/api/csharp/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource/constructors.md#constructor-string-parameterresource-parameterresource) -- Initializes a new instance of the [SurrealDbServerResource](/reference/api/csharp/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource.md) class.

## Properties

- [ConnectionStringExpression](/reference/api/csharp/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource/properties.md#connectionstringexpression) : `ReferenceExpression` `get` -- Gets the connection string expression for the SurrealDB instance.
- [Host](/reference/api/csharp/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource/properties.md#host) : `EndpointReferenceExpression` `get` -- Gets the host endpoint reference for this resource.
- [Namespaces](/reference/api/csharp/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource/properties.md#namespaces) : `IReadOnlyDictionary<string, string>` `get` -- A dictionary where the key is the resource name and the value is the namespace name.
- [PasswordParameter](/reference/api/csharp/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource/properties.md#passwordparameter) : `ParameterResource` `get` -- Gets the parameter that contains the SurrealDB password.
- [Port](/reference/api/csharp/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource/properties.md#port) : `EndpointReferenceExpression` `get` -- Gets the port endpoint reference for this resource.
- [PrimaryEndpoint](/reference/api/csharp/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource/properties.md#primaryendpoint) : `EndpointReference` `get` -- Gets the primary endpoint for the SurrealDB instance.
- [UriExpression](/reference/api/csharp/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource/properties.md#uriexpression) : `ReferenceExpression` `get` -- Gets the connection URI expression for the SurrealDB instance.
- [UserNameParameter](/reference/api/csharp/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource/properties.md#usernameparameter) : `ParameterResource?` `get` -- Gets the parameter that contains the SurrealDB username.

## Methods

- [GetConnectionStringAsync(CancellationToken)](/reference/api/csharp/communitytoolkit.aspire.hosting.surrealdb/surrealdbserverresource/methods.md#getconnectionstringasync-cancellationtoken) : `ValueTask<string?>` -- Gets the connection string for the SurrealDB instance.
