Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Failing Action<Car> To Action<List<Car>>
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { class Program { public static void Main(string[] args) { var car = ExpectCar(model => { foreach (var type in model.Types) { type.Name = "SuperStarShineType"; } }); } public static Car ExpectCar(Action<Car> preProcessor) { var car = new Car(); preProcessor.Invoke(car); var carList = new List<Car> { car }; var carActionList = new Action<List<Car>>(list => list = carList); return ExpectCars(carActionList).Single(); } public static List<Car> ExpectCars(Action<List<Car>> preProcessor) { var carList = new List<Car> { new Car { Types = new List<Type> { new Type {Name = "SuperCar"} } } }; preProcessor.Invoke(carList); return carList; } } class Car { public List<Type> Types { get; set; } } public class Type { public string Name { get; set; } } }
run
|
edit
|
history
|
help
0
Calculate X and Y using Lambda Expressions
Count the number of capital letters, small letters, digits, spaces and special characters.
Print All Cards
codejam1a1
Reference Type parameter by Ref vs. Normal
Program
Programmer DNA
6.1 Parallelism: race conditions
FindSmallest
Número primers