I have a list a analysts. Each analyst has a list of sector
public class Analyst : EntityNamed
{
List<Sector> sectors;
}
public class Sector: EntityNamed
{
List<Analyst> Analysts;
}
// I'm using a WCF service to get all the analyst :
public List<Analyst> GetAnalyts()
{
DataSet ds = EServiceClient.GetAnalysts();
foreach (DataRow row in ds.Tables[0].Rows) {
var analyst = new Analyst()
{
Name = row[1].ToString(),
LastName = row[2].ToString(),
PhoneNumber = row[3].ToString(),
Email = row[4].ToString()
};
}
//do something to prevent duplication of secotrs
}
The sectors are differentiate by their name
how can i do that without duplicating sectors in data Base ?
Thanks