public Company(Protobuf.Company companyPb) { this.Id = companyPb.Id; this.name = companyPb.Name; this.logo = companyPb.Logo.ToByteArray(); this.Bus = (HashSet <Bus>)companyPb.Bus.Select(b => new Bus(b)); }
public Protobuf.Company ToPBMessage() { Protobuf.Company companyPb = new Protobuf.Company(); companyPb.Id = this.Id; companyPb.Name = this.name; companyPb.Logo = Google.Protobuf.ByteString.CopyFrom(this.logo); companyPb.Bus.AddRange(this.Bus.Select(b => b.ToPBMessage())); return(companyPb); }