public async Task <ActivityLogging> GetOrCreateActivityAsync(IGuild guild) { var record = _coreContext.ActivityLogging.SingleOrDefault(x => x.GuildId == guild.Id); if (record == null) { _logging.Log($"Registering logging settings for {guild.Name} ({guild.Id})...", LogSeverity.Info); record = new ActivityLogging { GuildId = guild.Id }; _coreContext.ActivityLogging.Add(record); await SaveRepositoryAsync().ConfigureAwait(false); } return(record); }
public Task RemoveActivitySettingsAsync(ActivityLogging activitySettings) { _coreContext.ActivityLogging.Remove(activitySettings); return(SaveRepositoryAsync()); }
public async Task AddActivitySettingsAsync(ActivityLogging activitySettings) { await _coreContext.ActivityLogging.AddAsync(activitySettings).ConfigureAwait(false); await SaveRepositoryAsync().ConfigureAwait(false); }