Example code of how to implement a provider pattern in C#