public async Task <UpdateRecordFileScope> CreateAsync(UpdateRecordFileScope updateRecordFileScope, CancellationToken cancellationToken = default(CancellationToken)) { if (updateRecordFileScope == null) { throw new ArgumentNullException(nameof(updateRecordFileScope)); } Context.Add(updateRecordFileScope); await Context.SaveChangesAsync(cancellationToken); return(updateRecordFileScope); }
public async Task DeleteAsync(UpdateRecordFileScope updateRecordFileScope, CancellationToken cancellationToken = default(CancellationToken)) { if (updateRecordFileScope == null) { throw new ArgumentNullException(nameof(updateRecordFileScope)); } Context.Remove(updateRecordFileScope); try { await Context.SaveChangesAsync(cancellationToken); } catch (DbUpdateConcurrencyException) { throw; } }