No. There is no way to do that directly, as C# is a compiled language (unlike PHP which is interpreted) and requires all code to be compiled before ti is executed.
Having said that, you could do it:
Compiling C# Code at Runtime[
^] shows one way, but you would probably have to "encapsulate" your code in some kind of framework to get it all to work. A simple Google will find you others:
compile and execute c - Google Search[
^]
But...I'd think long and hard before I started with this: you are handing all control of your app and it's inner workings to whoever wants to bash together some code and get you to execute it. From a security POV, that's a nightmare - and from a reliability standpoint I could see a lot of bug reports coming that are caused by "user code" rather than yours.