#nullable enable
public sealed class LambdaFuncRetType
{
public static void Main(string[] args)
{
//want to return string and integer both from the method
//var ageValue0 = (gender) =>
//{
// if (gender == "Male") return 1;
// if (gender == "Female") return 0;
// else return "not valid gender";
//};
//1st way
var ageValue1 = object (string gender) =>
{
if (gender == "Male") return 1;
if (gender == "Female") return 0;
else return "not valid gender";
};
//2nd way
Func ageValue2 = (gender) =>
{
if (gender == "Male") return 1;
if (gender == "Female") return 0;
else return "not valid gender";
};
}
}