public virtual async Task UpdateAsync(string userId, CustomerPoolDefineRequest customerLossRequest, CancellationToken cancellationToken = default(CancellationToken)) { if (customerLossRequest == null) { throw new ArgumentNullException(nameof(customerLossRequest)); } var pooldefine = await Store.GetAsync(a => a.Where(b => b.Id == customerLossRequest.Id), cancellationToken); var customer = _mapper.Map <CustomerPoolDefine>(customerLossRequest); customer.CreateTime = pooldefine.CreateTime; customer.CreateUser = pooldefine.CreateUser; customer.DepartmentId = pooldefine.DepartmentId; customer.UpdateUser = userId; customer.UpdateTime = DateTime.Now; await Store.UpdateAsync(customer, cancellationToken); }
public virtual async Task <CustomerPoolDefineResponse> CreateAsync(UserInfo userInfo, CustomerPoolDefineRequest customerLossRequest, CancellationToken cancellationToken = default(CancellationToken)) { if (customerLossRequest == null) { throw new ArgumentNullException(nameof(customerLossRequest)); } var pool = _mapper.Map <CustomerPoolDefine>(customerLossRequest); pool.Id = Guid.NewGuid().ToString(); pool.CreateUser = userInfo.Id; pool.CreateTime = DateTime.Now; return(_mapper.Map <CustomerPoolDefineResponse>(await Store.CreateAsync(pool, cancellationToken))); }