public City(Protobuf.City cityPb) { this.Id = cityPb.Id; this.Name = cityPb.Name; this.BusStation = (HashSet<BusStation>)cityPb.BusStation.Select(bs => new BusStation(bs)); }
public Protobuf.City ToPBMessage() { Protobuf.City cityPb = new Protobuf.City(); cityPb.Id = this.Id; cityPb.Name = this.Name; cityPb.BusStation.AddRange(this.BusStation.Select(bs => bs.ToPBMessage())); return cityPb; }