The problem here is that you've defined an anonymous method which returns a string but are trying to assign it directly to a 's an expression which when invoked produces a string it's not directly a needs to be assigned to a compatible delegate type.