示例#1
0
 public ISector GetSector(string name)
 {
     return(Sectors.Find(sector => sector.Name.Equals(name)));
 }
示例#2
0
 public Sector GetSector(string sectorname)
 {
     return(Sectors.Find(sector => sector.Name.Equals(sectorname)) as Sector); //we want our specific implementation. We can do this because we know the list contains Sector objects
                                                                               //if it somehow cant be cast, this will return null
 }