We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sbroenne/mcp-server-excel'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
ResultAwaiterExtensions.cs•869 B
using System.Runtime.CompilerServices;
using Sbroenne.ExcelMcp.Core.Models;
namespace Sbroenne.ExcelMcp.Core.Tests.Helpers;
/// <summary>
/// Enables awaiting synchronous Core command results in tests without changing production APIs.
/// Wraps the result inside a completed task so existing async test patterns continue to compile.
/// </summary>
public static class ResultAwaiterExtensions
{
/// <summary>
/// Provides an awaiter for any result derived from <see cref="ResultBase"/>.
/// </summary>
/// <typeparam name="T">Result type</typeparam>
/// <param name="result">Result instance to await</param>
/// <returns>Awaiter that immediately returns the provided result</returns>
public static TaskAwaiter<T?> GetAwaiter<T>(this T? result)
where T : ResultBase
{
return Task.FromResult(result).GetAwaiter();
}
}