Fission dotnet 2.0 env (#337)

Adding a new dotnet environment, supporting dotnet core 2.0.

Project structure changed. Project.json was abandoned. Project.csproj is now used.
This commit is contained in:
João Almeida
2017-09-21 11:30:15 -07:00
committed by Soam Vasani
parent dc1ffa859d
commit 7bd3f20ad6
15 changed files with 751 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
using System.IO;
using System.Runtime.Serialization.Json;
using Fission.DotNetCore.Api;
public class FissionFunction
{
public string Execute(FissionContext context)
{
var person = Person.Deserialize(context.Request.Body);
return $"Hello, my name is {person.Name} and I am {person.Age} years old.";
}
}
public class Person
{
public string Name { get; set; }
public int Age { get; set; }
public static Person Deserialize(Stream json)
{
var serializer = new DataContractJsonSerializer(typeof(Person));
return (Person)serializer.ReadObject(json);
}
}