public void UseClient(string addr, int port) { if (Client != null) { Client.WithHost($"{addr}:{port}"); } else { Core.Channel channel = new Core.Channel($"{addr}:{port}", Core.ChannelCredentials.Insecure); Client = new Grpcconnect.Standard.gConnect.gConnectClient(channel); } }
public async Task <IActionResult> New(ChannelModel channel) { var newChannel = new Core.Channel() { Name = channel.ChannelName, Picture = channel.ChannelPicture ?? "", Creator = User.Identity.Name, ParticipantIds = new List <string>() { User.Identity.Name } }; var newChannelId = await channels.Create(newChannel); if (!String.IsNullOrWhiteSpace(newChannelId)) { return(Redirect("channel/" + newChannelId)); } return(View()); }