I need to create a List of a custom type with properties of type int, int
public class CustomClass
{
public int EmployeeID{get;set;}
public int ClientID{get;set;}
}
Two parameters that i have to create the list is List and int
My method is
CreateCustomClassList(List<int> EmployeeIDList, int clientID}
{
List<CustomClass> lst=new List<CustomClass>();
EmployeeIDList.ForEach
(u=>lst.Add(new CustomClass
{
ClientID=clientID,
EmployeeID=u
});
}
I don't want to run a Loop to do this, is there any more efficient way to do this.
CustomClasshas only private members. Is that intentional? Also your method has no return type?