コード例 #1
0
        public virtual async Task UpdateSupplierAsync(CreateSupplierInput input)
        {
            try
            {
                Debug.Assert(input.Id != null, "input.User.Id should be set.");

                var supplier = await _supplierManager.GetAsync(input.Id.Value);

                //Update user properties
                input.MapTo(supplier); //Passwords is not mapped (see mapping configuration)
                await _supplierRepository.UpdateAsync(supplier);
            }
            catch (Exception ex)
            {
                var e = ex;
            }
        }
コード例 #2
0
 public async Task CreateOrUpdateSupplier(CreateSupplierInput input)
 {
     try
     {
         if (input.Id.HasValue)
         {
             await UpdateSupplierAsync(input);
         }
         else
         {
             await CreateSupplierAsync(input);
         }
     }
     catch (Exception ex)
     {
         var e = ex;
     }
 }
コード例 #3
0
 public async Task CreateSupplier(CreateSupplierInput input)
 {
     var supplier = input.MapTo <Supplier>(); await _supplierRepository.InsertAsync(supplier);
 }
コード例 #4
0
 public virtual async Task CreateSupplierAsync(CreateSupplierInput input)
 {
     var @event = Supplier.Create(input.UserName, input.Address, input.Phone, input.Type);
     await _supplierManager.CreateAsync(@event);
 }