https://github.com/fnproject/fdk-dotnet
This project contains an implementation of FDK for C# running on dotnet runtime.
https://github.com/fnproject/fdk-dotnet
Last synced: about 1 year ago
JSON representation
This project contains an implementation of FDK for C# running on dotnet runtime.
- Host: GitHub
- URL: https://github.com/fnproject/fdk-dotnet
- Owner: fnproject
- License: other
- Created: 2021-12-10T09:55:30.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-02-21T09:44:02.000Z (over 1 year ago)
- Last Synced: 2025-05-09T01:59:09.923Z (about 1 year ago)
- Language: C#
- Size: 3.9 MB
- Stars: 6
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Fnproject.Fn.Fdk
This project contains an implementation of FDK for C# running on dotnet runtime.
## Usage
#### Add the project as a dependency from Nuget
https://www.nuget.org/packages/Fnproject.Fn.Fdk/
#### Use the Handle function in library to handle user function
```dotnet
using Fnproject.Fn.Fdk;
namespace example
{
class Program
{
public static string userFunc(string input) {
if(input.Length == 0) input = "World"
return string.Format("Hello, {0}!", input);
}
static void Main(string[] args)
{
Fdk.Handle(arg[0]);
}
}
}
```
While caliing the function, pass `namespace:class:function` as arguments to the binary.
To run the above example, use `dotnet func.dll example:Program:userFunc`.
#### Handle other content types
The library exposes interfaces for users to write serialization and deserialization logic
- `IInputCoercible` - This interface can be implemented on user type to modify deserialization of request body.
- `IOutputCoercible` - This interface can be implemented on user type to modify serialization of response body.