예제 #1
0
        public MediaRestrictedChannel GetOrCreateConfig(ulong channelId)
        {
            var config = GetConfig(channelId);

            if (config == null)
            {
                config           = new MediaRestrictedChannel();
                config.ChannelId = channelId;
                SaveConfig(config);
            }

            return(config);
        }
예제 #2
0
 public MediaRestrictedChannel GetConfig(ulong channelId)
 {
     return(Database.Load <MediaRestrictedChannel>(MediaRestrictedChannel.DocumentName(channelId)));
 }
예제 #3
0
 public void SaveConfig(MediaRestrictedChannel config)
 {
     Database.Store(config, MediaRestrictedChannel.DocumentName(config.ChannelId));
 }