I've been trying for long but can't seem to figure out the solution.
A function that takes a string and returns an object of type IVehicle.
Method Signature
public class Car: IVehicle
{
public static IVehicle GetCar(Func<string, IVehicle> lambda)
{
//...
}
Method Call
Car.GetCar("lambo" => new Car("lambo"));
Question:
What changes can I do to my call to be compatible with the method signature?
Targeting .NET Framework 4.5.1
x => new Car(x)is shorthand for(string x) => new Car(x), makes it easier to see why you can't substitute"lambo"forx.