public async Task <bool> SaveAsync(Domain.Models.ScheduledItem talk) { var dbScheduledItem = _mapper.Map <Sql.Models.ScheduledItem>(talk); _broadcastingContext.Entry(dbScheduledItem).State = talk.Id == 0 ? EntityState.Added : EntityState.Modified; return(await _broadcastingContext.SaveChangesAsync() != 0); }
public async Task <bool> SaveAsync(Domain.Models.Engagement engagement) { var dbEngagement = _mapper.Map <Models.Engagement>(engagement); _broadcastingContext.Entry(dbEngagement).State = dbEngagement.Id == 0 ? EntityState.Added : EntityState.Modified; return(await _broadcastingContext.SaveChangesAsync() != 0); }