示例#1
0
        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));
        }
示例#2
0
        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);
        }