Generate c# to access data