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;
            }
        }
 public async Task CreateOrUpdateSupplier(CreateSupplierInput input)
 {
     try
     {
         if (input.Id.HasValue)
         {
             await UpdateSupplierAsync(input);
         }
         else
         {
             await CreateSupplierAsync(input);
         }
     }
     catch (Exception ex)
     {
         var e = ex;
     }
 }
Ejemplo n.º 3
0
 public async Task CreateSupplier(CreateSupplierInput input)
 {
     var supplier = input.MapTo <Supplier>(); await _supplierRepository.InsertAsync(supplier);
 }
 public virtual async Task CreateSupplierAsync(CreateSupplierInput input)
 {
     var @event = Supplier.Create(input.UserName, input.Address, input.Phone, input.Type);
     await _supplierManager.CreateAsync(@event);
 }