Example #1
0
        public async Task <AgendaItem> SaveAgendaItem(AgendaItem item)
        {
            try
            {
                if (item.Id > 0)
                {
                    _dbContext.Update(item);
                }
                else
                {
                    await _dbContext.AddAsync(item);
                }

                await _dbContext.SaveChangesAsync();

                return(item);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
        public async Task <Speaker> SaveSpeaker(Speaker speaker)
        {
            try
            {
                if (speaker.Id > 0)
                {
                    _dbContext.Update(speaker);
                }
                else
                {
                    await _dbContext.AddAsync(speaker);
                }

                await _dbContext.SaveChangesAsync();

                return(speaker);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #3
0
        public async Task <PushSubscription> SavePushSubscription(PushSubscription push)
        {
            try
            {
                if (push.Id == 0)
                {
                    await _dbContext.AddAsync(push);
                }
                else
                {
                    _dbContext.Update(push);
                }

                await _dbContext.SaveChangesAsync();

                return(push);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #4
0
        public async Task <Exhibitor> SaveExhibitor(Exhibitor exhibitor)
        {
            try
            {
                if (exhibitor.Id > 0)
                {
                    _dbContext.Update(exhibitor);
                }
                else
                {
                    await _dbContext.AddAsync(exhibitor);
                }

                await _dbContext.SaveChangesAsync();

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