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; } }
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; } }
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; } }
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; } }