我是 GraphQL 新手。每当我运行我的项目时它都会显示
服务器无法访问
我交叉检查了项目文件,我猜问题出在该Startup.cs文件上。我尝试app.UseGraphQL在配置函数中使用,但 IDE 无法建议我使用正确的库。
这是我的代码:
using GraphQLMutationBasicCRUD.IService;
using GraphQLMutationBasicCRUD.Service;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using HotChocolate;
using GraphQLMutationBasicCRUD.GraphQL;
using HotChocolate.AspNetCore;
using HotChocolate.AspNetCore.Playground;
using Microsoft.AspNetCore.Http;
namespace GraphQLMutationBasicCRUD
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<IGroupService, …Run Code Online (Sandbox Code Playgroud) 我正在尝试实现Microsoft 的官方文档。当我尝试将号码输入拨号页面时,它会抛出异常,FeatureNotSupportedException 该异常按照文档说明
当尝试在不支持该功能的平台上使用该功能时发生的异常。
我使用的是 OnePlus AC2001 Android11.0 - API-30,我相信所有手机都必须包含拨号的基本功能PhoneDialer.Open(translatedNumber)
async void OnCall(object sender, System.EventArgs e)
{
if (await this.DisplayAlert(
"Dial a Number",
"Would you like to call " + translatedNumber + "?",
"Yes",
"No"))
{
try
{
PhoneDialer.Open(translatedNumber);
}
catch (ArgumentNullException)
{
await DisplayAlert("Unable to dial", "Phone number was not valid.", "OK");
}
catch (FeatureNotSupportedException)
{
await DisplayAlert("Unable to dial", "Phone dialing not supported.", "OK");
}
catch (Exception)
{
// Other error has occurred.
await …Run Code Online (Sandbox Code Playgroud)