Refactoring to make it c# consumable
adding a c# sample