public override async Task InsertAsync(MeetingAgenda entity) { foreach (var user in entity.MeetingAgendaUsers) { user.CreatedBy = entity.CreatedBy; user.CreatedDate = DateTime.Now; user.UpdatedBy = entity.UpdatedBy; user.UpdatedDate = DateTime.Now; } await Dbset.AddAsync(entity); }
public override async Task InsertAsync(MeetingNote entity) { var note = await this.Dbset .FirstOrDefaultAsync(x => x.UserId == entity.UserId && x.MeetingContentId == entity.MeetingContentId); if (note != null) { this.Dbset.Remove(note); } await Dbset.AddAsync(entity); }