This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Test-Output { | |
| Write-Output "Hello World" | |
| } | |
| function Test-Output2 { | |
| Write-Host "Hello World" -foreground Green | |
| } | |
| function Receive-Output { | |
| process { Write-Host $_ -foreground Yellow } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1,2,3 | %{ write-host $PSItem } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var anonymousData = new | |
| { | |
| ForeName = "Jignesh", | |
| SurName = "Trivedi" | |
| }; | |
| Console.WriteLine("First Name : " + anonymousData.ForeName); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public sealed class Singleton | |
| { | |
| // Because Singleton's constructor is private, we must explicitly | |
| // give the Lazy a delegate for creating the Singleton. | |
| static readonly Lazy instanceHolder = | |
| new Lazy(() => new Singleton()); | |
| Singleton() | |
| { | |
| // Explicit private constructor to prevent default public constructor. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static IEnumerable Where(this IEnumerable items, Predicate< T> prodicate) | |
| { | |
| foreach(var item in items) | |
| { | |
| if (predicate(item)) | |
| { | |
| // for lazy/deffer execution plus avoid temp collection defined | |
| yield return item; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class TweetsController : Controller { | |
| // GET: /Tweets/ | |
| [HttpGet] | |
| public ActionResult Index() { | |
| return Json(Twitter.GetTweets(), JsonRequestBehavior.AllowGet); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string place = "world"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string greet = String.Format("Hello {0}!", place); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class TweetsController : ApiController { | |
| // GET: /Api/Tweets/ | |
| public List Get() { | |
| return Twitter.GetTweets(); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Integrated Security = true; | |
| Integrated Security = SSPI; |