private DiscoveredService ConvertToProto(IDiscoveredService service) { var proto = DiscoveredService.Rent(); proto.ProvidedService = ConvertToProtoStrict(service.ProvidedService); proto.ConsumedService = ConvertToProtoStrict(service.ConsumedService); proto.ServiceTitle = service.ServiceTitle.ConvertToProto(); proto.Methods.AddRange(service.Methods.Select(ConvertToProto)); return(proto); }
public IDiscoveredService CreateDiscoveredService( IConsumedServiceReference consumedService, IProvidedServiceReference providedService, Maybe <string> serviceTitle, IReadOnlyCollection <IDiscoveredServiceMethod> methods) { var obj = DiscoveredService.Rent(); obj.ConsumedService = consumedService; obj.ProvidedService = providedService; obj.ServiceTitle = serviceTitle; obj.Methods = methods; return(obj); }