### Custom XML Service Discovery Serialization Source: https://context7.com/benjamincharlton/aspire4wasm/llms.txt Implement IServiceDiscoveryInfoSerializer to customize service discovery information serialization. This example uses XML. ```csharp // Custom implementation for XML serialization using Aspire.Hosting; using System.Xml.Linq; public class XmlServiceDiscoveryInfoSerializer : IServiceDiscoveryInfoSerializer { private readonly string _xmlFilePath; public XmlServiceDiscoveryInfoSerializer(string xmlFilePath) { _xmlFilePath = xmlFilePath; } public void SerializeServiceDiscoveryInfo(IResourceWithEndpoints resource) { var doc = File.Exists(_xmlFilePath) ? XDocument.Load(_xmlFilePath) : new XDocument(new XElement("Services")); var servicesElement = doc.Root!; // Remove existing resource element if present servicesElement.Elements(resource.Name).Remove(); var resourceElement = new XElement(resource.Name); if (resource.TryGetEndpoints(out var endpoints)) { foreach (var endpoint in endpoints) { if (endpoint.AllocatedEndpoint != null) { resourceElement.Add(new XElement(endpoint.Name, endpoint.AllocatedEndpoint.UriString)); } } } servicesElement.Add(resourceElement); doc.Save(_xmlFilePath); } } // Usage in AppHost Program.cs var builder = DistributedApplication.CreateBuilder(args); builder.AddStandaloneBlazorWebAssemblyProject( "blazor", (options, clientProject, environment) => { var xmlPath = Path.Combine( Path.GetDirectoryName(clientProject.ProjectPath)!, "wwwroot", "services.xml"); options.ServiceDiscoveryInfoSerializer = new XmlServiceDiscoveryInfoSerializer(xmlPath); }); builder.Build().Run(); ``` -------------------------------- ### Get Endpoints for Multiple Resources Source: https://context7.com/benjamincharlton/aspire4wasm/llms.txt Retrieves endpoint URLs for multiple Aspire resources. Useful for configuring CORS for multiple client applications. ```csharp // Program.cs in your ASP.NET Core Web API project using Microsoft.Extensions.Configuration; var builder = WebApplication.CreateBuilder(args); builder.AddServiceDefaults(); // Get endpoints for multiple client applications var allClientEndpoints = builder.Configuration.GetServiceEndpoints( "blazorclient", // Standalone WebAssembly client "hostedblazor", // Hosted Blazor app (Server + Client) "adminportal" // Another client application ); // Returns distinct URLs: ["https://localhost:7100", "http://localhost:5100", // "https://localhost:7200", "http://localhost:5200", // "https://localhost:7300", "http://localhost:5300"] builder.Services.AddCors(options => { options.AddDefaultPolicy(policy => { policy.WithOrigins(allClientEndpoints) .AllowAnyMethod() .AllowAnyHeader() .AllowCredentials(); // Enable for cookie-based auth }); }); var app = builder.Build(); app.UseCors(); app.MapGet("/weatherforecast", () => { var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm" }; return Enumerable.Range(1, 5).Select(index => new WeatherForecast( DateOnly.FromDateTime(DateTime.Now.AddDays(index)), Random.Shared.Next(-20, 55), summaries[Random.Shared.Next(summaries.Length)] )); }); app.Run(); record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary); ``` -------------------------------- ### Get All Service Endpoints for a Resource Source: https://context7.com/benjamincharlton/aspire4wasm/llms.txt Retrieves all HTTP and HTTPS endpoint URLs for a single Aspire resource. Returns both protocol endpoints as a string array, useful for CORS configuration. ```csharp // Program.cs in your ASP.NET Core Web API project using Microsoft.Extensions.Configuration; var builder = WebApplication.CreateBuilder(args); builder.AddServiceDefaults(); builder.Services.AddProblemDetails(); // Get all endpoints (http and https) for a single client resource var clientEndpoints = builder.Configuration.GetServiceEndpoints("blazorclient"); // Returns: ["https://localhost:7100", "http://localhost:5100"] builder.Services.AddCors(options => { options.AddDefaultPolicy(policy => { policy.WithOrigins(clientEndpoints) // Allow both HTTP and HTTPS .AllowAnyMethod() .WithHeaders("X-Requested-With", "Content-Type", "Authorization"); }); }); var app = builder.Build(); app.UseExceptionHandler(); app.UseCors(); app.MapGet("/api/inventory", () => new[] { new { Id = 1, Name = "Widget", Quantity = 100 }, new { Id = 2, Name = "Gadget", Quantity = 50 } }); app.Run(); ``` -------------------------------- ### Get Single Service Endpoint URL Source: https://context7.com/benjamincharlton/aspire4wasm/llms.txt Retrieves a single endpoint URL for an Aspire resource by its resource name and endpoint name. Useful for CORS configuration when a specific protocol is needed. ```csharp // Program.cs in your ASP.NET Core Web API project using Microsoft.Extensions.Configuration; var builder = WebApplication.CreateBuilder(args); builder.AddServiceDefaults(); // Get a single specific endpoint (throws if not found) var httpsEndpoint = builder.Configuration.GetServiceEndpoint("blazorclient", "https"); // Returns: "https://localhost:7100" var httpEndpoint = builder.Configuration.GetServiceEndpoint("blazorclient", "http"); // Returns: "http://localhost:5100" builder.Services.AddCors(options => { options.AddDefaultPolicy(policy => { policy.WithOrigins(httpsEndpoint) .AllowAnyMethod() .AllowAnyHeader(); }); }); var app = builder.Build(); app.UseCors(); app.Run(); ``` -------------------------------- ### Configure AppHost Projects Source: https://github.com/benjamincharlton/aspire4wasm/blob/master/README.md Define project relationships and service references using AddWebAssemblyClient and WithReference in the AppHost. ```csharp var builder = DistributedApplication.CreateBuilder(args); var inventoryApi = builder.AddProject("inventoryapi"); var billingApi = builder.AddProject("billingapi"); var blazorApp = builder.AddProject("hostedblazor") .AddWebAssemblyClient("wasmclient") .WithReference(inventoryApi) .WithReference(billingApi); inventoryApi.WithReference(blazorApp); // Could repeat the line above for billingApi but have not because its CORS settings say AllowAnyOrigin. builder.Build().Run(); ``` -------------------------------- ### Configure AppHost for Blazor WebAssembly Source: https://github.com/benjamincharlton/aspire4wasm/blob/master/README.md Demonstrates how to register a standalone Blazor WebAssembly project and establish bidirectional references with Web API projects in the AppHost Program.cs file. ```csharp var builder = DistributedApplication.CreateBuilder(args); var inventoryApi = builder.AddProject("inventoryapi"); var billingApi = builder.AddProject("billingapi"); var blazorApp = builder.AddStandAloneBlazorWebAssemblyProject("blazor") .WithReference(inventoryApi) .WithReference(billingApi); inventoryApi.WithReference(blazorApp); // Could repeat the line above for billingApi but have not because its CORS settings say AllowAnyOrigin. builder.Build().Run(); ``` -------------------------------- ### Configure Blazor WebAssembly with Aspire Service Defaults Source: https://github.com/benjamincharlton/aspire4wasm/blob/master/README.md In Program.cs, call builder.AddServiceDefaults() to enable Aspire service discovery. Configure HttpClients to use the service name for API calls. ```csharp builder.AddServiceDefaults(); builder.Services.AddHttpClient(client => client.BaseAddress = new Uri("https+http://inventoryapi")); builder.Services.AddHttpClient(client => client.BaseAddress = new Uri("https+http://billingapi")); ``` -------------------------------- ### Add WebAssembly Client with Custom Configuration Source: https://context7.com/benjamincharlton/aspire4wasm/llms.txt Configures a WebAssembly client in a hosted Blazor project with custom service discovery serialization. Requires the AppHost project. ```csharp // Program.cs in your AppHost project using Aspire.Hosting; var builder = DistributedApplication.CreateBuilder(args); var api = builder.AddProject("inventoryapi"); builder.AddProject("hostedblazor") .AddWebAssemblyClient( "wasmclient", (options, clientProject, environment) => { var appSettingsAccessor = new AppSettingsJsonFileAccessor( clientProject.ProjectPath, environment.EnvironmentName); options.ServiceDiscoveryInfoSerializer = new JsonServiceDiscoveryInfoSerializer(appSettingsAccessor); }) .WithReference(api); builder.Build().Run(); ``` -------------------------------- ### Add WebAssembly Client with Custom Serializer Source: https://github.com/benjamincharlton/aspire4wasm/blob/master/README.md Configure a WebAssembly client to use a custom service discovery information serializer by passing an instance to the AddWebAssemblyClient options. ```csharp var builder = DistributedApplication.CreateBuilder(args); var inventoryApi = builder.AddProject("inventoryapi"); builder.AddProject("hostedblazor") .AddWebAssemblyClient("wasmClient" options => { options.ServiceDiscoveryInfoSerializer = yourImplementation; }) .WithReference(inventoryApi) builder.Build().Run(); ``` -------------------------------- ### Configure Service Discovery in Blazor WebAssembly Source: https://github.com/benjamincharlton/aspire4wasm/blob/master/README.md Register service defaults and configure HttpClient instances for API communication in Program.cs. ```csharp builder.AddServiceDefaults(); builder.Services.AddHttpClient(client => client.BaseAddress = new Uri("https+http://inventoryapi")); builder.Services.AddHttpClient(client => client.BaseAddress = new Uri("https+http://billingapi")); ``` -------------------------------- ### Configure Aspire AppHost for Blazor Integration Source: https://context7.com/benjamincharlton/aspire4wasm/llms.txt Sets up the .NET Aspire AppHost to include a Web API, a standalone Blazor WebAssembly client, and a hosted Blazor application. It configures service discovery references between these projects. ```csharp // ============================================ // AppHost/Program.cs // ============================================ using Aspire.Hosting; var builder = DistributedApplication.CreateBuilder(args); // Add the Web API var weatherApi = builder.AddProject("weatherapi"); // Add standalone Blazor WebAssembly client var standaloneClient = builder.AddStandaloneBlazorWebAssemblyProject("standaloneclient") .WithReference(weatherApi); // Add hosted Blazor app with WebAssembly client var hostedApp = builder.AddProject("hostedblazor") .AddWebAssemblyClient("hostedclient") .WithReference(weatherApi); // Configure API to accept requests from both clients weatherApi.WithReference(standaloneClient); weatherApi.WithReference(hostedApp); builder.Build().Run(); ``` -------------------------------- ### Add Standalone Blazor WebAssembly Project with Custom Serialization Source: https://context7.com/benjamincharlton/aspire4wasm/llms.txt Configures custom service discovery serialization for advanced scenarios by providing a custom serializer implementation. ```csharp // Program.cs in your AppHost project using Aspire.Hosting; var builder = DistributedApplication.CreateBuilder(args); var api = builder.AddProject("inventoryapi"); // Add standalone WebAssembly project with custom serialization builder.AddStandaloneBlazorWebAssemblyProject( "blazorclient", (options, clientProject, environment) => { // Use default JSON serialization to appsettings var appSettingsAccessor = new AppSettingsJsonFileAccessor( clientProject.ProjectPath, environment.EnvironmentName); var serviceDiscoverySerializer = new JsonServiceDiscoveryInfoSerializer(appSettingsAccessor); options.ServiceDiscoveryInfoSerializer = serviceDiscoverySerializer; // Or implement your own IServiceDiscoveryInfoSerializer for XML, custom JSON, etc. }) .WithReference(api); builder.Build().Run(); ``` -------------------------------- ### Configure Aspire Service Discovery for Blazor WebAssembly Source: https://context7.com/benjamincharlton/aspire4wasm/llms.txt Enables Aspire service discovery for all HttpClients in a Blazor WebAssembly project. Register typed HttpClients using Aspire resource names. ```csharp // Program.cs in your Blazor WebAssembly project using Microsoft.AspNetCore.Components.WebAssembly.Hosting; var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); // Enable Aspire service discovery for all HttpClients builder.AddServiceDefaults(); // Register typed HttpClients using Aspire resource names builder.Services.AddHttpClient(client => client.BaseAddress = new Uri("https+http://inventoryapi")); builder.Services.AddHttpClient(client => client.BaseAddress = new Uri("https+http://billingapi")); // For hosted WebAssembly with interface/implementation pattern builder.Services.AddHttpClient(client => client.BaseAddress = new Uri("https+http://weatherapi")); await builder.Build().RunAsync(); // The "https+http://inventoryapi" URI is resolved using service discovery // from the Services section in appsettings.json written by the AppHost ``` -------------------------------- ### Aspire Service Discovery Configuration Structure Source: https://github.com/benjamincharlton/aspire4wasm/blob/master/README.md This JSON structure is written by AppHost to the client's appsettings file, enabling Aspire to discover service endpoints. ```json { "Services": { "inventoryapi": { "https": [ "https://localhost:1234" ], "http": [ "http://localhost:4321" ] }, "billingapi": { "https": [ "https://localhost:9876" ], "http": [ "http://localhost:6789" ] } } } ``` -------------------------------- ### Add WebAssembly Client to Hosted Project Source: https://context7.com/benjamincharlton/aspire4wasm/llms.txt Integrates a Blazor WebAssembly client into a hosted Blazor Server or Blazor Web App project within the Aspire model. ```csharp // Program.cs in your AppHost project using Aspire.Hosting; var builder = DistributedApplication.CreateBuilder(args); // Add your Web API var inventoryApi = builder.AddProject("inventoryapi"); // Add Blazor Server project, then chain the WebAssembly client var blazorApp = builder.AddProject("hostedblazor") .AddWebAssemblyClient("wasmclient") .WithReference(inventoryApi); // Add reverse reference for CORS configuration inventoryApi.WithReference(blazorApp); builder.Build().Run(); ``` -------------------------------- ### Configure Standalone Blazor WebAssembly Client Source: https://context7.com/benjamincharlton/aspire4wasm/llms.txt Configures a standalone Blazor WebAssembly application to use Aspire service discovery and sets up HttpClient to communicate with the Web API using the Aspire service URI scheme. ```csharp // ============================================ // StandaloneBlazorApp/Program.cs (WebAssembly) // ============================================ using Microsoft.AspNetCore.Components.WebAssembly.Hosting; var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); // Enable Aspire service discovery builder.AddServiceDefaults(); // Configure HttpClient with Aspire service discovery URI builder.Services.AddHttpClient(client => client.BaseAddress = new Uri("https+http://weatherapi")); await builder.Build().RunAsync(); ``` -------------------------------- ### Configure Web API with Aspire Service Discovery and CORS Source: https://context7.com/benjamincharlton/aspire4wasm/llms.txt Configures a Web API to enable Aspire service discovery and dynamically configures CORS policies based on the endpoints of registered Blazor clients. ```csharp // ============================================ // WeatherApi/Program.cs // ============================================ using Microsoft.Extensions.Configuration; var builder = WebApplication.CreateBuilder(args); builder.AddServiceDefaults(); // Configure CORS for all Blazor clients builder.Services.AddCors(options => { options.AddDefaultPolicy(policy => { var clients = builder.Configuration.GetServiceEndpoints( "standaloneclient", "hostedblazor"); policy.WithOrigins(clients) .AllowAnyMethod() .AllowAnyHeader(); }); }); var app = builder.Build(); app.UseCors(); app.MapGet("/weather", () => new[] { new { Date = DateTime.Now.AddDays(1), TempC = 20, Summary = "Mild" }, new { Date = DateTime.Now.AddDays(2), TempC = 25, Summary = "Warm" } }); app.Run(); ``` -------------------------------- ### IJsonFileAccessor Interface Source: https://github.com/benjamincharlton/aspire4wasm/blob/master/src/Aspire4Wasm.AppHost/PublicAPI.Unshipped.txt Methods for reading and saving JSON configuration files within the Aspire hosting environment. ```APIDOC ## IJsonFileAccessor ### Description Provides access to read and write JSON data for configuration purposes. ### Methods - **ReadFileAsJson()** -> JsonObject: Reads a file and returns it as a JsonObject. - **SaveJson(JsonObject updatedContent)** -> void: Saves the provided JsonObject to the file. ``` -------------------------------- ### Add Standalone Blazor WebAssembly Project Source: https://context7.com/benjamincharlton/aspire4wasm/llms.txt Registers a standalone Blazor WebAssembly project in the AppHost and automatically updates its appsettings file with service discovery data. ```csharp // Program.cs in your AppHost project using Aspire.Hosting; var builder = DistributedApplication.CreateBuilder(args); // Add your Web API projects var inventoryApi = builder.AddProject("inventoryapi"); var billingApi = builder.AddProject("billingapi"); // Add standalone Blazor WebAssembly project with service references var blazorApp = builder.AddStandaloneBlazorWebAssemblyProject("blazorclient") .WithReference(inventoryApi) .WithReference(billingApi); // Add reverse reference for CORS (API needs to know about client) inventoryApi.WithReference(blazorApp); billingApi.WithReference(blazorApp); builder.Build().Run(); ``` -------------------------------- ### AddStandaloneBlazorWebAssemblyProject Source: https://context7.com/benjamincharlton/aspire4wasm/llms.txt Adds a standalone Blazor WebAssembly project to the Aspire distributed application model. This method automatically writes service discovery information to the client's appsettings.{Environment}.json file. ```APIDOC ## POST /api/users ### Description Adds a standalone Blazor WebAssembly project to the Aspire distributed application model. This method writes service discovery information to the client's `appsettings.{Environment}.json` file automatically. ### Method POST ### Endpoint /api/users ### Parameters #### Path Parameters - **userId** (string) - Required - The ID of the user to retrieve. #### Query Parameters - **includeDetails** (boolean) - Optional - Whether to include detailed user information. ### Request Body - **username** (string) - Required - The username for the new user. - **email** (string) - Required - The email address for the new user. ### Request Example ```json { "username": "johndoe", "email": "john.doe@example.com" } ``` ### Response #### Success Response (200) - **userId** (string) - The unique identifier for the created user. - **message** (string) - A confirmation message. #### Response Example ```json { "userId": "123e4567-e89b-12d3-a456-426614174000", "message": "User created successfully." } ``` ``` -------------------------------- ### AddStandaloneBlazorWebAssemblyProject with Custom Serialization Source: https://context7.com/benjamincharlton/aspire4wasm/llms.txt Adds a standalone Blazor WebAssembly project with custom service discovery serialization behavior for advanced scenarios. This allows for custom serialization formats like XML or custom JSON structures. ```APIDOC ## PUT /api/users/{userId} ### Description Updates an existing user's information. This endpoint allows for partial or full updates to user data. ### Method PUT ### Endpoint /api/users/{userId} ### Parameters #### Path Parameters - **userId** (string) - Required - The ID of the user to update. #### Request Body - **username** (string) - Optional - The updated username. - **email** (string) - Optional - The updated email address. ### Request Example ```json { "email": "john.doe.updated@example.com" } ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the user was updated. #### Response Example ```json { "message": "User updated successfully." } ``` ``` -------------------------------- ### Configure ASP.NET Core Web API CORS with Aspire Service Endpoints Source: https://github.com/benjamincharlton/aspire4wasm/blob/master/README.md In Program.cs, configure CORS policies using Aspire's GetServiceEndpoints helper methods to allow cross-origin requests from your Blazor client. ```csharp builder.Services.AddCors(options => { options.AddDefaultPolicy(policy => { var clients = builder.Configuration.GetServiceEndpoints("hostedblazor"); // Get the http and https endpoints for the client known by resource name as "blazor" in the AppHost. // var clients = builder.Configuration.GetServiceEndpoints("blazor1", "blazor2"); // This overload does the same thing for multiple clients. // var clients = builder.Configuration.GetServiceEndpoint("blazor", "http"); // This overload gets a single named endpoint for a single resource. In this case, the "http" endpoint for the "blazor" resource. policy.WithOrigins(clients); // Add the clients as allowed origins for cross origin resource sharing. policy.AllowAnyMethod(); policy.WithHeaders("X-Requested-With"); }); }); // ... other stuff var app = builder.Build(); // ... other stuff app.UseCors(); ``` -------------------------------- ### AddWebAssemblyClient Source: https://context7.com/benjamincharlton/aspire4wasm/llms.txt Adds a Blazor WebAssembly client project to an existing Blazor Server/hosted project in the distributed application model. This is used for hosted WebAssembly apps or Blazor Web Apps with InteractiveAuto render mode. ```APIDOC ## DELETE /api/users/{userId} ### Description Deletes a user from the system. ### Method DELETE ### Endpoint /api/users/{userId} ### Parameters #### Path Parameters - **userId** (string) - Required - The ID of the user to delete. ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the user was deleted. #### Response Example ```json { "message": "User deleted successfully." } ``` ``` -------------------------------- ### Custom IServiceDiscoveryInfoSerializer Implementation Source: https://github.com/benjamincharlton/aspire4wasm/blob/master/README.md Implement the IServiceDiscoveryInfoSerializer interface by overriding the SerializeServiceDiscoveryInfo method. This is used when custom serialization logic is required for service discovery information. ```csharp public void SerializeServiceDiscoveryInfo(IResourceWithServiceDiscovery resource) { } ``` -------------------------------- ### BlazorResourceBuilderExtensions Source: https://github.com/benjamincharlton/aspire4wasm/blob/master/src/Aspire4Wasm.AppHost/PublicAPI.Unshipped.txt Extension methods for IResourceBuilder to add WebAssembly clients to Blazor Server projects. ```APIDOC ## AddWebAssemblyClient ### Description Adds a WebAssembly client project to an existing Blazor Server project resource builder. ### Parameters - **blazorServerProjectBuilder** (IResourceBuilder) - Required - The server project resource builder. - **webAssemblyProjectName** (string) - Required - The name of the client project. - **configure** (Action) - Optional - Configuration delegate for WebAssemblyProjectBuilderOptions. ``` -------------------------------- ### Configure CORS for Web API Source: https://github.com/benjamincharlton/aspire4wasm/blob/master/README.md Use GetServiceEndpoints to dynamically set allowed origins for cross-origin requests in the Web API project. ```csharp builder.Services.AddCors(options => { options.AddDefaultPolicy(policy => { var clients = builder.Configuration.GetServiceEndpoints("blazor"); // Get the http and https endpoints for the client known by resource name as "blazor" in the AppHost. // var clients = builder.Configuration.GetServiceEndpoints("blazor1", "blazor2"); // This overload does the same thing for multiple clients. // var clients = builder.Configuration.GetServiceEndpoint("blazor", "http"); // This overload gets a single named endpoint for a single resource. In this case, the "http" endpoint for the "blazor" resource. policy.WithOrigins(clients); // Add the clients as allowed origins for cross origin resource sharing. policy.AllowAnyMethod(); policy.WithHeaders("X-Requested-With"); }); }); ``` -------------------------------- ### BlazorDistributedApplicationBuilderExtensions Source: https://github.com/benjamincharlton/aspire4wasm/blob/master/src/Aspire4Wasm.AppHost/PublicAPI.Unshipped.txt Extension methods for IDistributedApplicationBuilder to add standalone Blazor WebAssembly projects. ```APIDOC ## AddStandaloneBlazorWebAssemblyProject ### Description Adds a standalone Blazor WebAssembly project to the distributed application builder. ### Parameters - **builder** (IDistributedApplicationBuilder) - Required - The application builder instance. - **webAssemblyProjectName** (string) - Required - The name of the project. - **configure** (Action) - Optional - Configuration delegate for WebAssemblyProjectBuilderOptions. ``` -------------------------------- ### GetServiceEndpoints Source: https://context7.com/benjamincharlton/aspire4wasm/llms.txt Retrieves endpoint URLs for multiple Aspire resources to facilitate CORS policy configuration. ```APIDOC ## GetServiceEndpoints ### Description Retrieves endpoint URLs for multiple Aspire resources at once. This is useful when your API serves multiple client applications and needs to allow CORS for all of them. ### Method C# Extension Method ### Parameters #### Query Parameters - **resourceNames** (params string[]) - Required - The names of the Aspire resources to retrieve endpoints for. ### Response - **string[]** - An array of distinct URLs associated with the requested resources. ``` -------------------------------- ### IServiceDiscoveryInfoSerializer Source: https://context7.com/benjamincharlton/aspire4wasm/llms.txt Interface for customizing the serialization of service discovery information for WebAssembly client applications. ```APIDOC ## IServiceDiscoveryInfoSerializer ### Description Implement this interface to customize how service discovery information is serialized and stored for your WebAssembly client applications. ### Method Interface Implementation ### Parameters #### Request Body - **resource** (IResourceWithEndpoints) - Required - The resource object containing endpoint information to be serialized. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.