Esempio n. 1
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;
            }
        }
Esempio n. 2
0
        public async Task <Event> SaveEvent(Event item)
        {
            try
            {
                if (item.Id > 0)
                {
                    _dbContext.Update(item);
                }
                else
                {
                    await _dbContext.AddAsync(item);
                }

                await _dbContext.SaveChangesAsync();

                return(item);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 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;
            }
        }
Esempio n. 4
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;
            }
        }
Esempio n. 5
0
        public async Task <bool> AddUserAgendaItem(UserAgendaItem item)
        {
            try
            {
                await _dbContext.AddAsync(item);

                await _dbContext.SaveChangesAsync();

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