private async Task OnExecuteAsync(IConsole console) { var tenantId = Guid.Parse(Id); var tenantResult = await Shared.GetTenantManagementApi(console).GetTenant(tenantId); if (!tenantResult.Success) { tenantResult.ToConsoleResultWithDefaultMessages().WriteMessages(console); return; } var tenant = tenantResult.Data.First(); if (!string.IsNullOrEmpty(Name)) { tenant.Name = Name; } if (!string.IsNullOrEmpty(Hostnames)) { tenant.Hostnames = Hostnames.Split(';'); } var tenantUpdateResult = await Shared.GetTenantManagementApi(console).UpdateTenant(tenant); tenantUpdateResult.ToConsoleResultWithDefaultMessages().WriteMessages(console); if (tenantUpdateResult.Success) { ConsoleOutputTenants(console, tenantUpdateResult.Data.First()); } }
private async Task OnExecuteAsync(IConsole console) { TenantDto tenant = new TenantDto { Name = Name, Hostnames = Hostnames.Split(';') }; var tenantAddResult = await Shared.GetTenantManagementApi(console).AddTenant(tenant); tenantAddResult.ToConsoleResultWithDefaultMessages().WriteMessages(console); ConsoleOutputTenants(console, tenantAddResult.Data.First()); }
public RabbitMQClientConfiguration From(RabbitMQClientConfiguration config) { Username = config.Username; Password = config.Password; Exchange = config.Exchange; ExchangeType = config.ExchangeType; DeliveryMode = config.DeliveryMode; RouteKey = config.RouteKey; Port = config.Port; VHost = config.VHost; Protocol = config.Protocol; Heartbeat = config.Heartbeat; UseBackgroundThreadsForIO = config.UseBackgroundThreadsForIO; SslOption = config.SslOption; foreach (string hostName in config.Hostnames) { Hostnames.Add(hostName); } return(this); }
public bool Equals([AllowNull] TenantDto other) { return(TenantId == other.TenantId && Name == other.Name && Enumerable.SequenceEqual(Hostnames.OrderBy(x => x), other.Hostnames.OrderBy(x => x))); }