Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud Functions
  • Comparing with other Yandex Cloud services
    • Overview
      • Overview
      • Function interface
      • YcFunction interface
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Error handling
    • Using the SDK
  • Tools
  • Pricing policy
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  • FAQ
  1. Developing in .NET Core
  2. Programming model
  3. Overview

C# programming model

Written by
Yandex Cloud
Updated at July 2, 2026
View in Markdown

Cloud Functions provides two models for programming in C#: one is based on the YcFunction interface, the other, on an independent class with a compatible method. Both models require custom implementations of the interfaces and allow the function to accept one argument and one return value of any type.

The difference between these models is the availability of the invocation context. For example, if you need to work with Yandex Cloud services using the SDK, we recommend opting for YcFunction.

No matter which model you select, the project can be uploaded either as a published csproj project or as *cs files with source code. The second option is suitable for handlers without external dependencies. The class that contains the handler must also meet the following requirements:

  1. It must be public.
  2. It must have a public no-argument constructor.
    It is provided by default. However, if you created your own constructor with arguments, you should also create a no-argument one.
  3. It must not be generic.

No matter which model you select, the handler can be an async method that returns Task or Task<T>. For the independent class option, the async void return type is also available.

In this case, there are two distinct types: byte[] and String. They are used slightly differently from other types. If you use them as the handler argument type, the runtime will not convert the incoming request into JSON and instead will provide it directly to the user-defined handler, unless ?integration=raw is used.

Was the article helpful?

Previous
Overview
Next
Function interface
© 2026 Direct Cursus Technology L.L.C.