re: Action-Oriented C# VIEW POST

TOP OF THREAD FULL DISCUSSION
re: I agree with the syntax issues. TypeScript has type aliases where you can name a union of types for example. .NET cod use something similar. That...
 

You can use delegates or functional interfaces to have alias.

A functional interface is an interface with only one method, as suggested above.

With the delegate, you can have:

public delegate decimal CalculateScore();

This is totally compatible with Lambdas and Funcs. And a safe way to do a Strategy Pattern like you want.

code of conduct - report abuse