add csharp implementation and test