示例#1
0
        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);
        }
示例#2
0
 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) { }
 }