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
newMultDiv
Uri Parts
Morse code
Free cash app money
Static Class
JJ 2
ggg
Plt-D v.0.9.6 (Speed Vector)
Triangle
Collatz Conjecture Using Pi