Stacie
asked on
Trying to understand what this mean...types(lstTypes[i].AvailableDatatype)
I'm having a hard time understanding this simple line of
: types(lstTypes[i].AvailableDatatype);
using System;
using System.Collections.Generic;
namespace ConsoleApplicationTest
{
class Program
{
static void Main(string[] args)
{
List<DotNet> lstTypes = new List<DotNet>();
DotNet bltypes = new DotNet();
bltypes.AvailableDatatype = "bool";
lstTypes.Add(bltypes);
DotNet strTypes = new DotNet();
strTypes.AvailableDatatype = "string";
lstTypes.Add(strTypes);
DotNet intTypes = new DotNet();
intTypes.AvailableDatatype = "int";
lstTypes.Add(intTypes);
DotNet decTypes = new DotNet();
decTypes.AvailableDatatype = "decimal";
lstTypes.Add(decTypes);
types += x =>
{
Console.WriteLine(x);
Console.ReadLine();
};
for (int i = 0; i <= lstTypes.Count - 1; i++)
{
types(lstTypes[i].AvailableDatatype);
}
}
static event Action<string> types;
}
public class DotNet
{
public string AvailableDatatype { get; set; }
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This, including the answer above will help you understand what is going on.