Skip to content

Aliyun FunctionCompute .netcore runtime libs.

License

Notifications You must be signed in to change notification settings

fanzhe328/fc-dotnet-libs

 
 

Repository files navigation

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

About

Aliyun FunctionCompute .netcore runtime libs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%