I have an ObservableCollection,
public class Company : ObservableCollection<Employee>
{
public Company(string P_companyName){
companyName = P_companyName;
}
public string companyName{ get; set; }
}
It is an ObservableCollection of this;
public class Employee
{
public string FirstName{get;set;}
public string LastName{get;set;}
public string City{get;set;}
}
I've made a List like this;
List<Company> companiesWemployees = new List<Company>();
This is the way to add an item,
companiesWemployees.Add(new Company("Xamarin"){
new Employee { FirstName = "John", LastName = "Doe", City = "LA"},
new Employee { FirstName = "Jane", LastName = "Doe", City = "NY"}
});
Is it possible to add a single employee to the list without adding a company name?