public IConsumedServiceReference CreateConsumedServiceReference(string serviceId, Maybe <string> serviceAlias)
        {
            var obj = ConsumedServiceReference.Rent();

            obj.ServiceId    = serviceId;
            obj.ServiceAlias = serviceAlias;
            return(obj);
        }
        private static ConsumedServiceReference ConvertToProtoStrict(IConsumedServiceReference obj)
        {
            var proto = ConsumedServiceReference.Rent();

            proto.ServiceId    = obj.ServiceId.ConvertToProtoStrict();
            proto.ServiceAlias = obj.ServiceAlias.ConvertToProto();
            return(proto);
        }
        private static ConsumedServiceReference ConvertToProto(Maybe <IConsumedServiceReference> obj)
        {
            if (!obj.HasValue)
            {
                return(null);
            }
            var proto = ConsumedServiceReference.Rent();

            proto.ServiceAlias = obj.Value.ServiceAlias.ConvertToProto();
            proto.ServiceId    = obj.Value.ServiceId.ConvertToProtoStrict();
            return(proto);
        }
 private Maybe <IConsumedServiceReference> ConvertFromProto(ConsumedServiceReference proto)
 {
     return(proto == null
         ? Maybe <IConsumedServiceReference> .Nothing
         : new Maybe <IConsumedServiceReference>(ConvertFromProtoStrict(proto)));
 }
 private IConsumedServiceReference ConvertFromProtoStrict(ConsumedServiceReference proto)
 {
     return(_messageFactory.CreateConsumedServiceReference(
                proto.ServiceId.ConvertFromProtoStrict(),
                proto.ServiceAlias.ConvertFromProto()));
 }