开发者

How do I learn this "any ... func" code?

开发者 https://www.devze.com 2023-02-06 12:57 出处:网络
I with could re-write the question better, but can someone tell me whe开发者_C百科re I can learn what is happening in this piece of azure code?

I with could re-write the question better, but can someone tell me whe开发者_C百科re I can learn what is happening in this piece of azure code?

How do I learn this "any ... func" code?


That code has about three non-basic concepts in it:

  • Extension Methods

    Extension methods enable you to "add" methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type.

  • LINQ (Language-Integrated Query)

    Language-Integrated Query (LINQ) is a set of features introduced in Visual Studio 2008 that extends powerful query capabilities to the language syntax of C# and Visual Basic.

  • Lambda Expressions

    A lambda expression is an anonymous function that can contain expressions and statements, and can be used to create delegates or expression tree types.


It simply returns true if one of the items in the changes collections is a RoleConfigurationSettingChange.

This is one of the LINQ extension methods and has nothing to do with Azure.


This method is checking to see if any of the changes passed into the RoleEnvironmentChanging method are a configuration change.

By looking at the list of changes, it uses the .Any method to see if any of the changes are of the type RoleEnvironmentConfigurationSettingsChange.


Further reading ... http://msdn.microsoft.com/en-us/library/bb534972.aspx

Its essentially saying if that if there are any changes of type specified then execute the body of the if statement.

Hope that helps

0

精彩评论

暂无评论...
验证码 换一张
取 消