public async Task Test() { using (NekoDbContext dbContext = new NekoDbContext()) { var modLog = dbContext.ModerationLogs; foreach (var item in modLog) { await ReplyAsync(String.Format("{0,5} {1,5} {2,5} {3,5}", item.Timestamp, item.Action, item.Reason, $"<@{item.TargetedUserId}>")); } } }
private async Task AddModerationLog(ModerationLog.ModAction action, IGuildUser user, string reason) { using (NekoDbContext dbContext = new NekoDbContext()) { ModerationLog newModerationLog = new ModerationLog { ExecutingUserId = context.User.Id, ExecutingUsername = context.User.Username, TargetedUserId = user.Id, TargetUsername = user.Username, Reason = reason, Timestamp = DateTime.UtcNow }; dbContext.ModerationLogs.Add(newModerationLog); await dbContext.SaveChangesAsync(); } }
public static void LoadConfig() { #if DEBUG BotToken = ""; CommandPrefix = '!'; Debug = true; #elif RELEASE BotToken = ""; CommandPrefix = '&'; Debug = false; #endif //TODO Load config file //TODO Check if DB file exist using (NekoDbContext dbContext = new NekoDbContext()) { //TODO Load DB Config } }
public BaseRepository(NekoDbContext context) { _dbContext = context; }
public MenuRepository(NekoDbContext context) : base(context) { }
public QuestionRepository(NekoDbContext context) : base(context) { }
public SolutionRepository(NekoDbContext context) : base(context) { }
public ExamPaperRepository(NekoDbContext context) : base(context) { }
public ExamRecordQuestionRepository(NekoDbContext context) : base(context) { }
public ExamRecordRepository(NekoDbContext dbContext) : base(dbContext) { }
public UserRepository(NekoDbContext context) : base(context) { }
public RoleRepository(NekoDbContext context) : base(context) { }