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
| // for loop | |
| var items = new List<Item>(); | |
| foreach (var i in existingItems) { | |
| items.Add(new Item(i)); | |
| } | |
| // linq statement | |
| var items = existingItems.Select(x => new Item(x)).ToList(); |
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
| class Program | |
| { | |
| public static Dictionary<Type, object> Stubs = new Dictionary<Type, object> | |
| { | |
| { | |
| typeof (GetUserById), new StubGetUserById(x => new Person { Name = string.Format("{0} {1} {2}", x.FirstName, x.LastName, "Test") } ) | |
| } | |
| }; | |
| static void Main(string[] args) |
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
| open System.Drawing | |
| open System.Windows.Forms | |
| type HelloWindow() = | |
| let frm = new Form(Width = 400, Height = 140) | |
| let fnt = new Font("Time New Roman", 28.0f) | |
| let lbl = new Label(Dock = DockStyle.Fill, Font = fnt, TextAlign = ContentAlignment.MiddleCenter) | |
| do frm.Controls.Add(lbl) |
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 var GetPost(string id) { | |
| var post = Db.Posts.Find(id); | |
| return post as IPost; | |
| } |
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
| using System; | |
| using System.Dynamic; | |
| using System.Text; | |
| namespace Spiffy | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { |
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
| using Funq; | |
| using Raven.Client; | |
| using ServiceStack.Authentication.RavenDb; | |
| using ServiceStack.CacheAccess; | |
| using ServiceStack.CacheAccess.Providers; | |
| using ServiceStack.Configuration; | |
| using ServiceStack.ServiceInterface; | |
| using ServiceStack.ServiceInterface.Auth; | |
| using ServiceStack.WebHost.Endpoints; |
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
| using System; | |
| using EndToEnd.Core; | |
| using FluentAssertions; | |
| using ServiceStack.FluentValidation; | |
| using ServiceStack.ServiceClient.Web; | |
| using ServiceStack.ServiceInterface.Auth; | |
| using Xunit; | |
| namespace EndToEnd | |
| { |
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
| using System; | |
| using EndToEnd.Core; | |
| using FluentAssertions; | |
| using ServiceStack.FluentValidation; | |
| using ServiceStack.ServiceClient.Web; | |
| using ServiceStack.ServiceInterface.Auth; | |
| using Xunit; | |
| namespace EndToEnd | |
| { |
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
| using System; | |
| using System.Collections.Generic; | |
| namespace RandomScheduler | |
| { | |
| class Program | |
| { | |
| public static Random R = new Random(); | |
| static void Main() |
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
| // Had to modify the ScriptCs ScriptExecutor to include System.Configuration | |
| // It works as expected to get the appSettings, but not the natural way | |
| // most devs will be used to with ConfigurationManager.AppSettings, also | |
| // not sure if things like SmtpClient will pickup on it. | |
| using System; | |
| using System.Configuration; | |
| var path = Environment.CurrentDirectory + "\\app.config"; | |
| Console.WriteLine(path); |