× Share your code snippets, screen shots etc. here

Method Syntax - functional programm !?

2 years 2 months ago #1 by Phil Hepburn
Method Syntax - functional programm !? was created by Phil Hepburn
Hi Nick, (and all)

When you use Method Syntax (with Lambda Expressions) in your big app, do you think it is like Functional Programming ?

Does each successive method take as input the exact output from the previous method ?

It would seem to me that some of the formats of the 'Query Syntax' although it uses Method Syntax under the hood, it may also reorder the sugary query syntax to suit some unstated criteria.

I think the above may be more true / likely for "LINQ to SQL" and "LINQ to 'Entity'". Where the Order By clause always needs to be last in the SQL query statement, but can by other places in the LINQ query code line statement.

What do you do and what are your thoughts on this / these ideas ?


Please Log in or Create an account to join the conversation.

2 years 2 months ago #2 by Nick Friend
Replied by Nick Friend on topic Method Syntax - functional programm !?
Hi Phil,

Not sure about how query syntax works internally, but with method syntax it's as you say, each method takes as it's input the output of the previous method (to the left) in the chain... so you start from the left and work to the right, and the last thing to occur on the right is the return value.

So you literally chain methods together to refine your data until you get to the result you want.



Please Log in or Create an account to join the conversation.