263613093 / cloudbase-dotnet-sdk

云开发 .NET SDK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CloudBase .NET SDK

介绍

CloudBase 提供开发应用所需服务和基础设施。CloudBase .NET SDK 让你可以在客户端访问 CloudBase 的服务。

安装

  • 打包 SDK
dotnet pack
  • 在你的项目里引入 SDK
cd your_project

dotnet nuget add source LocalPath // LocalPath是你保存 CloudBase Sdk 的路径

dotnet add package CloudBase

快速上手

using System.Threading.Tasks;
using System.Collections.Generic;
using CloudBase;

// 初始化
CloudBaseApp app = CloudBaseApp.Init("your-env-id", 3000);

// 匿名登录
AuthState state = await app.Auth.GetAuthStateAsync();
if (state == null) {
  await app.Auth.SignInAnonymouslyAsync();
}

// 调用云函数
var param = new Dictionary<string, dynamic>() { {"a", 1}, {"b", 2} };
FunctionResponse res = await app.Function.CallFunctionAsync("sum", param);

详细文档

About

云开发 .NET SDK


Languages

Language:C# 100.0%