Skip to content

Latest commit

 

History

History
61 lines (47 loc) · 2.08 KB

README.md

File metadata and controls

61 lines (47 loc) · 2.08 KB

Aliyun FunctionCompute C# Libraries

Software License GitHub version Build Status

Overview

The SDK of this version is dependent on the third-party library Json.NET. This componenent is for Aliyun FunctionCompute developers to build C# functions.

Running environment

Applicable to .net core 2.1 or above

Installation

Install the SDK through NuGet

  • If NuGet hasn't been installed for Visual Studio, install NuGet first.

  • After NuGet is installed, access Visual Studio to create a project or open an existing project, and then select TOOLS > NuGet Package Manager > Manage NuGet Packages for Solution.

  • For normal invoke function, type Aliyun.Serverless.Core in the search box and click Search, select the latest version, and click Install.

  • For http invoke function, beside Aliyun.Serverless.Core, you also need to install Aliyun.Serverless.Core.Http.

Getting started

using System;
using System.IO;
using System.Threading.Tasks;
using Aliyun.Serverless.Core;
using Microsoft.Extensions.Logging;
namespace samples
{
    public class TestHandler
    {
        public async Task<Stream> EchoEvent(Stream input, IFcContext context)
        {
            context.Logger.LogInformation("Handle Request: {0}", context.RequestId);
            MemoryStream memoryStream = new MemoryStream();
            await input.CopyToAsync(memoryStream);
            return memoryStream;
        }
    }
}

More resources

Contacting us