public async Task <CustomerDealFileInfo> CreateAsync(CustomerDealFileInfo fileInfo, CancellationToken cancellationToken = default(CancellationToken)) { if (fileInfo == null) { throw new ArgumentNullException(nameof(fileInfo)); } Context.Add(fileInfo); await Context.SaveChangesAsync(cancellationToken); return(fileInfo); }
public async Task UpdateAsync(CustomerDealFileInfo fileInfo, CancellationToken cancellationToken = default(CancellationToken)) { if (fileInfo == null) { throw new ArgumentNullException(nameof(fileInfo)); } Context.Attach(fileInfo); Context.Update(fileInfo); try { await Context.SaveChangesAsync(cancellationToken); } catch (DbUpdateConcurrencyException) { } }