コード例 #1
0
        public City(Protobuf.City cityPb)
        {
            this.Id = cityPb.Id;
            this.Name = cityPb.Name;

            this.BusStation = (HashSet<BusStation>)cityPb.BusStation.Select(bs => new BusStation(bs));
        }
コード例 #2
0
        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;
        }