コード例 #1
0
 /// <inheritdoc/>
 public async Task RegisterAsync(ServerRegistrationRequestModel request)
 {
     if (request == null)
     {
         throw new ArgumentNullException(nameof(request));
     }
     if (request.DiscoveryUrl == null)
     {
         throw new ArgumentNullException(nameof(request.DiscoveryUrl));
     }
     if (string.IsNullOrEmpty(request.Id))
     {
         request.Id = Guid.NewGuid().ToString();
     }
     await DiscoverAsync(new DiscoveryRequestModel {
         Configuration = new DiscoveryConfigModel {
             ActivationFilter = request.ActivationFilter.Clone(),
             DiscoveryUrls    = new List <string> {
                 request.DiscoveryUrl
             },
         },
         Id      = request.Id,
         Context = request.Context.Clone()
     });
 }
コード例 #2
0
 /// <inheritdoc/>
 public async Task RegisterAsync(ServerRegistrationRequestModel request)
 {
     if (request == null)
     {
         throw new ArgumentNullException(nameof(request));
     }
     if (request.DiscoveryUrl == null)
     {
         throw new ArgumentNullException(nameof(request.DiscoveryUrl));
     }
     if (string.IsNullOrEmpty(request.RegistrationId))
     {
         request.RegistrationId = Guid.NewGuid().ToString();
     }
     await DiscoverAsync(new DiscoveryRequestModel {
         Configuration = new DiscoveryConfigModel {
             ActivationFilter = request.ActivationFilter,
             Callbacks        = request.Callback == null ? null :
                                new List <CallbackModel> {
                 request.Callback
             },
             DiscoveryUrls = new List <string> {
                 request.DiscoveryUrl
             },
             Locales = request.Locales
         },
         Id = request.RegistrationId,
     });
 }
コード例 #3
0
 /// <summary>
 /// Create from service model
 /// </summary>
 /// <param name="model"></param>
 public ServerRegistrationRequestApiModel(
     ServerRegistrationRequestModel model)
 {
     DiscoveryUrl = model.DiscoveryUrl;
     Callback     = model.Callback == null ? null :
                    new CallbackApiModel(model.Callback);
     ActivationFilter = model.ActivationFilter == null ? null :
                        new EndpointActivationFilterApiModel(model.ActivationFilter);
 }