public async Task <IActionResult> Create([FromBody] ChannelForm data) { using (var ctx = DataFactory.GetDataContext()) { var channel = new Channel() { OwnerId = User.GetUserId(), CreateDateUTC = DateTime.UtcNow, Title = data.channelTitle, Description = data.channelDescription, Status = "STOPPED", }; await ctx.Channel.AddAsync(channel); var channelPlaylist = new ChannelPlaylist() { ChannelId = channel.Id, Playlist = "[]" }; var channelLibrary = new ChannelLibrary() { ChannelId = channel.Id, Library = "[]" }; await ctx.ChannelPlaylist.AddAsync(channelPlaylist); await ctx.ChannelLibrary.AddAsync(channelLibrary); await ctx.SaveChangesAsync(); return(Ok(channel.Id)); } }
public void Join(ITimerModel model, string id) { var channel = new RacetimeChannel(model.CurrentState, model); var form = new ChannelForm(channel, id, model.CurrentState.LayoutSettings.AlwaysOnTop); }