public BusType(Protobuf.BusType busTypePb) { this.Id = busTypePb.Id; this.Name = busTypePb.Name; this.Seats = busTypePb.Seats; this.Bus = (HashSet <Bus>)busTypePb.Bus.Select(b => new Bus(b)); }
public Protobuf.BusType ToPBMessage() { Protobuf.BusType busTypePb = new Protobuf.BusType(); busTypePb.Id = this.Id; busTypePb.Name = this.Name; busTypePb.Seats = this.Seats; busTypePb.Bus.AddRange(this.Bus.Select(b => b.ToPBMessage())); return(busTypePb); }