public virtual async Task DeleteAsync(UserInfo userInfo, CompanyAInfo companyAInfo, CancellationToken cancellationToken = default(CancellationToken)) { //var companyAInfo = Store.GetAsync<CompanyAInfo>(a => a.Where(b => b.ID == id), cancellationToken); if (companyAInfo == null) { throw new ArgumentNullException(nameof(companyAInfo)); } await Store.DeleteAsync(userInfo, companyAInfo, cancellationToken); }
public async Task <CompanyAInfo> CreateAsync(CompanyAInfo companyAInfo, CancellationToken cancellationToken = default(CancellationToken)) { if (companyAInfo == null) { throw new ArgumentNullException(nameof(CompanyAInfo)); } Context.CompanyAInfo.Add(companyAInfo); await Context.SaveChangesAsync(cancellationToken); return(companyAInfo); }
public async Task UpdateAsync(CompanyAInfo companyAInfo, CancellationToken cancellationToken = default(CancellationToken)) { if (companyAInfo == null) { throw new ArgumentNullException(nameof(companyAInfo)); } Context.CompanyAInfo.Attach(companyAInfo); Context.CompanyAInfo.Update(companyAInfo); try { await Context.SaveChangesAsync(cancellationToken); } catch (DbUpdateConcurrencyException) { throw; } }
//Task<List<FileInfo>> CreateListAsync(List<CompanyAInfo> companyAInfoList, CancellationToken cancellationToken = default(CancellationToken)); public async Task DeleteAsync(UserInfo userInfo, CompanyAInfo companyAInfo, CancellationToken cancellationToken = default(CancellationToken)) { if (companyAInfo == null) { throw new ArgumentException(nameof(CompanyAInfo)); } companyAInfo.DeleteTime = DateTime.Now; companyAInfo.DeleteUser = userInfo.Id; companyAInfo.IsDelete = true; Context.CompanyAInfo.Update(companyAInfo); try { await Context.SaveChangesAsync(cancellationToken); } catch (DbUpdateConcurrencyException) { throw; } }