Exemple #1
0
        public async Task <bool> DeleteSponsor(int sponsorId)
        {
            try
            {
                var sponsor = await GetSponsorById(sponsorId);

                _dbContext.Remove(sponsor);
                await _dbContext.SaveChangesAsync();

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #2
0
        public async Task <bool> RemoveUserAgendaItem(int agendaItemId, string userId)
        {
            try
            {
                var item = await _dbContext.UserAgendaItem.Where(i => i.AgendaItemId == agendaItemId).Where(i => i.UserId == userId).FirstOrDefaultAsync();

                _dbContext.Remove(item);
                await _dbContext.SaveChangesAsync();

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #3
0
        public async Task <bool> DeleteSpeaker(int speakerId)
        {
            try
            {
                var speaker = await GetSpeakerById(speakerId);

                var items = await _dbContext.AgendaItemSpeaker.Where(i => i.SpeakerId == speakerId).ToListAsync();

                _dbContext.RemoveRange(items);
                _dbContext.Remove(speaker);
                await _dbContext.SaveChangesAsync();

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }