A little creativity combined with Linq (which basically is a functional language embedded in C# as becomes more obvious when watching Dr. Erik Meijers great video series on Haskell) will allow you to make your code look more functional.
Here an example without using Linq:
Haskell:
minThree :: Int -> Int -> Int -> Int
minThree x y z
| x <= y && x <=z = x
| y <=z = y
| otherwise = z
C#:
int MinThree(int x, int y, int z)
{
return
x <= y && x <= z ? x
: y <= z ? y
: z;
}
Just don't let Resharper Code Cleanup run over your code as it will make it look like this:
int MinThree(int x, int y, int z)
{
return
x <= y && x <= z
? x
: y <= z
? y
: z;
}
:(