public async Task DeleteAsync(int id) { var controlEvent = await _dbContext.ControlEvents.FirstOrDefaultAsync(ce => ce.MailId == id); _dbContext.Remove(controlEvent); await _dbContext.SaveChangesAsync(); }
public async Task DeleteTextAsync(int id) { _dbContext.Remove(_dbContext.Texts.FirstOrDefaultAsync(t => t.TextId == id)); await _dbContext.SaveChangesAsync(); }